pub struct MeshClient { /* private fields */ }Implementations§
Source§impl MeshClient
impl MeshClient
pub async fn new(cfg: MeshClientConfig) -> Result<Self, Error>
pub async fn register(&self, card: &AgentCard) -> Result<(), Error>
Sourcepub async fn request(
&self,
opts: RequestOptions,
) -> Result<MatchOrReject, Error>
pub async fn request( &self, opts: RequestOptions, ) -> Result<MatchOrReject, Error>
Publish a capability request on the control plane and await a reply. Returns the raw JSON reply as serde_json::Value for now.
Sourcepub async fn listen(
&self,
handler: MatchHandler,
) -> Result<ListenSubscription, Error>
pub async fn listen( &self, handler: MatchHandler, ) -> Result<ListenSubscription, Error>
Listen for matches directed to this agent DID. Handler will be invoked for each incoming match/reject.
Sourcepub async fn start_heartbeat(
&self,
interval_ms: u64,
) -> Result<HeartbeatHandle, Error>
pub async fn start_heartbeat( &self, interval_ms: u64, ) -> Result<HeartbeatHandle, Error>
Start periodic heartbeats to the control plane.
pub async fn close(self) -> Result<(), Error>
Auto Trait Implementations§
impl !RefUnwindSafe for MeshClient
impl !UnwindSafe for MeshClient
impl Freeze for MeshClient
impl Send for MeshClient
impl Sync for MeshClient
impl Unpin for MeshClient
impl UnsafeUnpin for MeshClient
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
Mutably borrows from an owned value. Read more