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
impl AtlasClient
Sourcepub async fn connect(endpoint: impl AsRef<str>) -> Result<Self>
pub async fn connect(endpoint: impl AsRef<str>) -> Result<Self>
Connect once. Accepts bare host:port or full http://host:port.
Sourcepub async fn connect_with_retry(
endpoint: impl AsRef<str>,
attempts: u32,
delay: Duration,
) -> Result<Self>
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.
pub fn inner(&self) -> AtlasClient<Channel>
Sourcepub async fn register_primitive(
&mut self,
id: &str,
namespace: &str,
capability_md_path: &str,
) -> Result<String>
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.
Sourcepub async fn register_service(
&mut self,
id: &str,
namespace: &str,
capability_md_path: &str,
) -> Result<String>
pub async fn register_service( &mut self, id: &str, namespace: &str, capability_md_path: &str, ) -> Result<String>
Register a Service.
Sourcepub async fn register_skill(
&mut self,
id: &str,
namespace: &str,
capability_md_path: &str,
) -> Result<String>
pub async fn register_skill( &mut self, id: &str, namespace: &str, capability_md_path: &str, ) -> Result<String>
Register a Skill.
Sourcepub async fn unregister(&mut self, id: &str) -> Result<bool>
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).
pub async fn heartbeat(&mut self, id: &str) -> Result<()>
Sourcepub async fn set_lifecycle_state(
&mut self,
id: &str,
new_state: LifecycleState,
detail: &str,
) -> Result<()>
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.
Sourcepub async fn declare_capability(
&mut self,
provider_id: &str,
contract_id: &str,
transport: Transport,
endpoint: &str,
params: TransportParams,
) -> Result<String>
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.
Sourcepub async fn declare_capability_with_description(
&mut self,
provider_id: &str,
contract_id: &str,
transport: Transport,
endpoint: &str,
params: TransportParams,
description: &str,
) -> Result<String>
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).
Sourcepub async fn query(
&mut self,
kind: Kind,
id: &str,
contract_id: &str,
namespace_prefix: &str,
transport: Transport,
) -> Result<Vec<CapabilityProvider>>
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.
Sourcepub async fn query_primitives(
&mut self,
id: &str,
contract_id: &str,
namespace_prefix: &str,
transport: Transport,
) -> Result<Vec<CapabilityProvider>>
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).
Sourcepub async fn query_services(
&mut self,
id: &str,
contract_id: &str,
namespace_prefix: &str,
transport: Transport,
) -> Result<Vec<CapabilityProvider>>
pub async fn query_services( &mut self, id: &str, contract_id: &str, namespace_prefix: &str, transport: Transport, ) -> Result<Vec<CapabilityProvider>>
Convenience — find Services.
Sourcepub async fn query_skills(
&mut self,
id: &str,
contract_id: &str,
namespace_prefix: &str,
transport: Transport,
) -> Result<Vec<CapabilityProvider>>
pub async fn query_skills( &mut self, id: &str, contract_id: &str, namespace_prefix: &str, transport: Transport, ) -> Result<Vec<CapabilityProvider>>
Convenience — find Skills.
Sourcepub async fn flatten_capabilities(
&mut self,
contract_id: &str,
namespace_prefix: &str,
transport: Transport,
) -> Result<Vec<Capability>>
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.
Sourcepub async fn query_capabilities(
&mut self,
id: &str,
contract_id: &str,
transport: Transport,
) -> Result<Vec<CapabilityProvider>>
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).
Sourcepub async fn connect_capability(
&mut self,
consumer_id: &str,
provider_id: &str,
contract_id: &str,
transport: Transport,
) -> Result<(String, String, TransportParams)>
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).
Sourcepub async fn disconnect_capability(&mut self, channel_id: &str) -> Result<bool>
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.
Sourcepub async fn query_contract(
&mut self,
contract_id: &str,
) -> Result<Option<ContractDescriptor>>
pub async fn query_contract( &mut self, contract_id: &str, ) -> Result<Option<ContractDescriptor>>
Look up one contract by id.
pub async fn list_contracts( &mut self, namespace_prefix: &str, ) -> Result<Vec<ContractDescriptor>>
Trait Implementations§
Source§impl Clone for AtlasClient
impl Clone for AtlasClient
Source§fn clone(&self) -> AtlasClient
fn clone(&self) -> AtlasClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for AtlasClient
impl !RefUnwindSafe for AtlasClient
impl Send for AtlasClient
impl Sync for AtlasClient
impl Unpin for AtlasClient
impl UnsafeUnpin for AtlasClient
impl !UnwindSafe for AtlasClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].