pub struct TracingSinkRegistryClient {
pub new_span_method_id: u32,
pub record_method_id: u32,
pub event_method_id: u32,
pub enter_method_id: u32,
pub exit_method_id: u32,
pub drop_span_method_id: u32,
/* private fields */
}Expand description
Registry-aware client stub for the #trait_name service.
This client resolves method IDs from a [ServiceRegistry] at construction time.
This can be useful when you want to validate the service/methods are registered
(or when building tooling around introspection).
It has the same RpcSession requirements as [#client_name].
Fields§
§new_span_method_id: u32§record_method_id: u32§event_method_id: u32§enter_method_id: u32§exit_method_id: u32§drop_span_method_id: u32Implementations§
Source§impl TracingSinkRegistryClient
impl TracingSinkRegistryClient
Sourcepub fn new(session: Arc<RpcSession>, registry: &ServiceRegistry) -> Self
pub fn new(session: Arc<RpcSession>, registry: &ServiceRegistry) -> Self
Create a new registry-aware client.
Looks up method IDs from the registry. The service must be registered in the registry before calling this constructor.
The session’s demux loop (session.run()) must be running for RPC calls to work.
§Panics
Panics if the service or any of its methods are not found in the registry.
Sourcepub fn session(&self) -> &Arc<RpcSession>
pub fn session(&self) -> &Arc<RpcSession>
Get a reference to the underlying session.
Sourcepub async fn new_span(&self, span: SpanMeta) -> Result<u64, RpcError>
pub async fn new_span(&self, span: SpanMeta) -> Result<u64, RpcError>
Call the #name method on the remote service.
Sourcepub async fn record(
&self,
span_id: u64,
fields: Vec<Field>,
) -> Result<(), RpcError>
pub async fn record( &self, span_id: u64, fields: Vec<Field>, ) -> Result<(), RpcError>
Call the #name method on the remote service.
Sourcepub async fn event(&self, event: EventMeta) -> Result<(), RpcError>
pub async fn event(&self, event: EventMeta) -> Result<(), RpcError>
Call the #name method on the remote service.
Sourcepub async fn enter(&self, span_id: u64) -> Result<(), RpcError>
pub async fn enter(&self, span_id: u64) -> Result<(), RpcError>
Call the #name method on the remote service.