pub trait NetBenchSession: Send + Sync {
// Required methods
fn remote_peer_id(&self) -> String;
fn telemetry(&self) -> NetBenchTelemetry;
fn max_datagram_size(&self) -> Option<usize>;
fn open_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn NetBenchBidirectionalStream>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn accept_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn NetBenchBidirectionalStream>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_datagram<'life0, 'async_trait>(
&'life0 self,
bytes: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read_datagram<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A flow-scoped view of one caller-owned authenticated peer session.
Implementations perform typed Stream and Datagram demultiplexing. Therefore accept_bi and
read_datagram must never return traffic belonging to another host business flow.
Required Methods§
Sourcefn remote_peer_id(&self) -> String
fn remote_peer_id(&self) -> String
Stable, non-secret remote identity for the report.
Sourcefn telemetry(&self) -> NetBenchTelemetry
fn telemetry(&self) -> NetBenchTelemetry
Samples path and transport counters without active probing.
Sourcefn max_datagram_size(&self) -> Option<usize>
fn max_datagram_size(&self) -> Option<usize>
Current maximum application Datagram payload.
Sourcefn open_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn NetBenchBidirectionalStream>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn NetBenchBidirectionalStream>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Opens one stream already typed as part of this netbench flow.
Sourcefn accept_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn NetBenchBidirectionalStream>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn accept_bi<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn NetBenchBidirectionalStream>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Accepts the next stream already routed to this netbench flow.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".