Skip to main content

AtlasClient

Struct AtlasClient 

Source
pub struct AtlasClient { /* private fields */ }
Expand description

Wrapped pb::atlas_client::AtlasClient with helpers.

Cheap to clone — the inner generated client wraps a Channel, which is itself just a handle to a connection pool. Share clones across tasks rather than wrapping in a Mutex.

Implementations§

Source§

impl AtlasClient

Source

pub async fn connect(endpoint: impl AsRef<str>) -> Result<Self>

Connect once. Accepts bare host:port or full http://host:port.

Source

pub async fn connect_with_retry( endpoint: impl AsRef<str>, attempts: u32, delay: Duration, ) -> Result<Self>

connect, retrying up to attempts times with delay between tries.

Source

pub fn inner(&self) -> AtlasClient<Channel>

Source

pub async fn register_primitive( &mut self, id: &str, namespace: &str, capability_md_path: &str, ) -> Result<String>

Register a Primitive. Returns the (possibly Atlas-assigned) id.

Source

pub async fn register_service( &mut self, id: &str, namespace: &str, capability_md_path: &str, ) -> Result<String>

Register a Service.

Source

pub async fn register_skill( &mut self, id: &str, namespace: &str, capability_md_path: &str, ) -> Result<String>

Register a Skill.

Source

pub async fn unregister(&mut self, id: &str) -> Result<bool>

Unregister any registered entity. Returns true if a record was removed, false if the id was unknown (idempotent).

Source

pub async fn heartbeat(&mut self, id: &str) -> Result<()>

Source

pub async fn set_lifecycle_state( &mut self, id: &str, new_state: LifecycleState, detail: &str, ) -> Result<()>

Push a lifecycle state transition. detail is a free-form human-readable note (e.g. “missing /opt/models/…”) that rbnx caps surfaces verbatim; pass empty when there’s nothing.

Source

pub async fn declare_capability( &mut self, provider_id: &str, contract_id: &str, transport: Transport, endpoint: &str, params: TransportParams, ) -> Result<String>

Declare one Capability (transport-bound endpoint) on an entity. Returns the authoritative endpoint (may differ from the request when Atlas rewrote to disambiguate). description is the optional natural-language description for this Capability.

Source

pub async fn declare_capability_with_description( &mut self, provider_id: &str, contract_id: &str, transport: Transport, endpoint: &str, params: TransportParams, description: &str, ) -> Result<String>

Same as declare_capability but with the instance-specific description string (see DeclareCapabilityRequest.description).

Source

pub async fn query( &mut self, kind: Kind, id: &str, contract_id: &str, namespace_prefix: &str, transport: Transport, ) -> Result<Vec<CapabilityProvider>>

Generic Query. kind == Kind::Unspecified = no kind filter (all kinds returned; each CapabilityProvider.kind carries its kind). Empty strings / Transport::Unspecified = no filter on that field.

Source

pub async fn query_primitives( &mut self, id: &str, contract_id: &str, namespace_prefix: &str, transport: Transport, ) -> Result<Vec<CapabilityProvider>>

Convenience — find Primitives (kind filter applied).

Source

pub async fn query_services( &mut self, id: &str, contract_id: &str, namespace_prefix: &str, transport: Transport, ) -> Result<Vec<CapabilityProvider>>

Convenience — find Services.

Source

pub async fn query_skills( &mut self, id: &str, contract_id: &str, namespace_prefix: &str, transport: Transport, ) -> Result<Vec<CapabilityProvider>>

Convenience — find Skills.

Source

pub async fn flatten_capabilities( &mut self, contract_id: &str, namespace_prefix: &str, transport: Transport, ) -> Result<Vec<Capability>>

Consumer-facing discovery: flat list of Capabilities across all kinds. Walks Query(kind=Unspecified) and flattens each CapabilityProvider’s nested capabilities. Each returned Capability already carries provider_id + provider_kind.

Source

pub async fn query_capabilities( &mut self, id: &str, contract_id: &str, transport: Transport, ) -> Result<Vec<CapabilityProvider>>

Back-compat alias for the legacy 3-arg signature returning a list of CapabilityProviders. Equivalent to query(Kind::Unspecified, id, contract_id, "", transport).

Source

pub async fn connect_capability( &mut self, consumer_id: &str, provider_id: &str, contract_id: &str, transport: Transport, ) -> Result<(String, String, TransportParams)>

Open a channel to one (provider, contract, transport). Atlas only providers the edge — the consumer dials the returned endpoint itself using whatever transport-appropriate mechanism (tonic for grpc, rclrs for ros2, fastmcp for mcp, …). Returns (channel_id, endpoint, params).

Source

pub async fn disconnect_capability(&mut self, channel_id: &str) -> Result<bool>

Release a previously-opened channel. Idempotent: returns false when the channel_id was unknown.

Source

pub async fn query_contract( &mut self, contract_id: &str, ) -> Result<Option<ContractDescriptor>>

Look up one contract by id.

Source

pub async fn list_contracts( &mut self, namespace_prefix: &str, ) -> Result<Vec<ContractDescriptor>>

Trait Implementations§

Source§

impl Clone for AtlasClient

Source§

fn clone(&self) -> AtlasClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more