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

Trait UZeroCopyTransportCore

Source
pub trait UZeroCopyTransportCore: Send + Sync {
    type Tx: UTxBuffer + Send;
    type Rx: UEncodedRxFrame + Send + 'static;

    // Required methods
    fn loan_prepared_tx<'life0, 'async_trait>(
        &'life0 self,
        spec: PreparedTxLoanSpec,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Tx, UStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_prepared_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;

    // Provided methods
    fn receive_encoded_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_encoded_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _source_filter: &'life1 UUri,
        _sink_filter: Option<&'life2 UUri>,
        _listener: Arc<dyn UEncodedZeroCopyListener<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_encoded_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _source_filter: &'life1 UUri,
        _sink_filter: Option<&'life2 UUri>,
        _listener: Arc<dyn UEncodedZeroCopyListener<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: implemented by transports that stay a dumb byte pipe; UWireTransport composes wires and codecs above it (recommended default) — see the trait map.

Encoded physical zero-copy mechanics implemented by product transports.

Implementing this core buys UWireTransport composition with every compatible UWire and metadata codec. The prepared loan spec contains metadata bytes already encoded by the selected profile; this trait must carry them without interpreting, relabeling, or re-encoding them.

TX loan and commit are required. Pull receive and listener hooks default to unsupported. UZeroCopyUninitTransportCore adds one uninitialized-loan operation, while the adapter supplies validation, identity checks, stable initialization, semantic public traits, and listener wrappers.

Required Associated Types§

Source

type Tx: UTxBuffer + Send

Transport-specific transmit loan type.

Source

type Rx: UEncodedRxFrame + Send + 'static

Transport-specific raw encoded receive type.

Required Methods§

Source

fn loan_prepared_tx<'life0, 'async_trait>( &'life0 self, spec: PreparedTxLoanSpec, ) -> Pin<Box<dyn Future<Output = Result<Self::Tx, UStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reserves transmit storage for a request with already encoded metadata bytes.

Source

fn send_prepared_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 transmit loan prepared by this core.

Provided Methods§

Source

fn receive_encoded_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 raw encoded frame from cores that support pull receive.

Source

fn register_encoded_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _source_filter: &'life1 UUri, _sink_filter: Option<&'life2 UUri>, _listener: Arc<dyn UEncodedZeroCopyListener<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 raw encoded listener after public filter validation.

Source

fn unregister_encoded_zero_copy_listener<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _source_filter: &'life1 UUri, _sink_filter: Option<&'life2 UUri>, _listener: Arc<dyn UEncodedZeroCopyListener<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 raw encoded listener after public filter validation.

Implementors§