pub trait UZeroCopyTransport:
Sealed
+ Send
+ Sync {
type Tx: UTxBuffer + Send;
type Rx: UZeroCopyRxLease + Send + 'static;
// Required methods
fn loan_tx<'life0, 'async_trait>(
&'life0 self,
spec: UTxLoanSpec,
) -> Pin<Box<dyn Future<Output = Result<Self::Tx, UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_zero_copy<'life0, 'async_trait>(
&'life0 self,
buffer: Self::Tx,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn receive_zero_copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_filter: &'life1 UUri,
sink_filter: Option<&'life2 UUri>,
) -> Pin<Box<dyn Future<Output = Result<Self::Rx, UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn register_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_filter: &'life1 UUri,
sink_filter: Option<&'life2 UUri>,
listener: Arc<dyn UZeroCopyListener<Self::Rx>>,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn unregister_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_filter: &'life1 UUri,
sink_filter: Option<&'life2 UUri>,
listener: Arc<dyn UZeroCopyListener<Self::Rx>>,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Role: called by users of the zero-copy family; transports implement UZeroCopyTransportImpl or the encoded core instead — see the trait map.
The zero-copy transport capability API.
Required Associated Types§
Sourcetype Tx: UTxBuffer + Send
type Tx: UTxBuffer + Send
Transport-specific transmit loan type returned by Self::loan_tx.
Sourcetype Rx: UZeroCopyRxLease + Send + 'static
type Rx: UZeroCopyRxLease + Send + 'static
Transport-specific receive lease type returned by pull receive and listeners.
Required Methods§
Sourcefn loan_tx<'life0, 'async_trait>(
&'life0 self,
spec: UTxLoanSpec,
) -> Pin<Box<dyn Future<Output = Result<Self::Tx, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn loan_tx<'life0, 'async_trait>(
&'life0 self,
spec: UTxLoanSpec,
) -> Pin<Box<dyn Future<Output = Result<Self::Tx, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reserves transmit storage for a validated frame loan spec.
Sourcefn send_zero_copy<'life0, 'async_trait>(
&'life0 self,
buffer: Self::Tx,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_zero_copy<'life0, 'async_trait>(
&'life0 self,
buffer: Self::Tx,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Commits a previously reserved transmit loan.
Sourcefn receive_zero_copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_filter: &'life1 UUri,
sink_filter: Option<&'life2 UUri>,
) -> Pin<Box<dyn Future<Output = Result<Self::Rx, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn receive_zero_copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_filter: &'life1 UUri,
sink_filter: Option<&'life2 UUri>,
) -> Pin<Box<dyn Future<Output = Result<Self::Rx, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Receives one matching zero-copy frame from transports that support pull receive.
Sourcefn register_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_filter: &'life1 UUri,
sink_filter: Option<&'life2 UUri>,
listener: Arc<dyn UZeroCopyListener<Self::Rx>>,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn register_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_filter: &'life1 UUri,
sink_filter: Option<&'life2 UUri>,
listener: Arc<dyn UZeroCopyListener<Self::Rx>>,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Registers a listener for matching zero-copy receive leases.
Sourcefn unregister_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_filter: &'life1 UUri,
sink_filter: Option<&'life2 UUri>,
listener: Arc<dyn UZeroCopyListener<Self::Rx>>,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn unregister_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_filter: &'life1 UUri,
sink_filter: Option<&'life2 UUri>,
listener: Arc<dyn UZeroCopyListener<Self::Rx>>,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Unregisters a listener for matching zero-copy receive leases.