Preview of the proposed up-rust native-frame-model branch (up-rust b6b99c6d, up-spec f0e9b17) — not released documentation. branch · write-up

Trait UZeroCopyTransport

Source
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§

Source

type Tx: UTxBuffer + Send

Transport-specific transmit loan type returned by Self::loan_tx.

Source

type Rx: UZeroCopyRxLease + Send + 'static

Transport-specific receive lease type returned by pull receive and listeners.

Required Methods§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Implementors§