pub struct CellLifecycleClient { /* private fields */ }Expand description
Client stub for the #trait_name service.
This client uses hardcoded method IDs (1, 2, …) and expects an
Arc<RpcSession> whose
run task is already
running. Construct sessions with RpcSession::with_channel_start to
coordinate odd/even channel IDs when both peers initiate RPCs.
For multi-service scenarios where method IDs must be globally unique,
use [#registry_client_name] instead.
§Usage
ⓘ
let session = Arc::new(RpcSession::new(transport));
tokio::spawn(session.clone().run()); // Start the demux loop
let client = FooClient::new(session);
let result = client.some_method(args).await?;Implementations§
Source§impl CellLifecycleClient
impl CellLifecycleClient
Sourcepub fn new(session: Arc<RpcSession>) -> Self
pub fn new(session: Arc<RpcSession>) -> Self
Create a new client with the given RPC session.
Uses compile-time, on-wire method IDs (hashed Service.method).
For registry-resolved method IDs, use [#registry_client_name::new].
The provided session must be shared (Arc::clone) with the call site
and have its demux loop (tokio::spawn(session.clone().run())) running.
Sourcepub fn session(&self) -> &Arc<RpcSession>
pub fn session(&self) -> &Arc<RpcSession>
Get a reference to the underlying session.
Auto Trait Implementations§
impl Freeze for CellLifecycleClient
impl !RefUnwindSafe for CellLifecycleClient
impl Send for CellLifecycleClient
impl Sync for CellLifecycleClient
impl Unpin for CellLifecycleClient
impl !UnwindSafe for CellLifecycleClient
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