pub struct TracingConfigClient<T: Transport> { /* private fields */ }Expand description
Client stub for the #trait_name service.
This client uses hardcoded method IDs (1, 2, …) and expects an
Arc<RpcSession<T>> 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<T: Transport + Send + Sync + 'static> TracingConfigClient<T>
impl<T: Transport + Send + Sync + 'static> TracingConfigClient<T>
Sourcepub fn new(session: Arc<RpcSession<T>>) -> Self
pub fn new(session: Arc<RpcSession<T>>) -> Self
Create a new client with the given RPC session.
Uses hardcoded method IDs (1, 2, …). For registry-based method IDs,
use [#registry_client_name::new] instead.
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<T>>
pub fn session(&self) -> &Arc<RpcSession<T>>
Get a reference to the underlying session.
Auto Trait Implementations§
impl<T> Freeze for TracingConfigClient<T>
impl<T> !RefUnwindSafe for TracingConfigClient<T>
impl<T> Send for TracingConfigClient<T>
impl<T> Sync for TracingConfigClient<T>
impl<T> Unpin for TracingConfigClient<T>
impl<T> !UnwindSafe for TracingConfigClient<T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more