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

Trait UEncodedRxFrame

Source
pub trait UEncodedRxFrame {
    type PayloadReader<'a>: Read + 'a
       where Self: 'a;
    type PayloadSlices<'a>: Iterator<Item = &'a [u8]> + 'a
       where Self: 'a;

    // Required methods
    fn encoded_metadata(&self) -> &[u8] ;
    fn payload_len(&self) -> usize;
    fn payload_reader(&self) -> Self::PayloadReader<'_>;
    fn payload_slices(&self) -> Self::PayloadSlices<'_>;

    // Provided method
    fn try_contiguous_payload(&self) -> Option<&[u8]> { ... }
}
Expand description

Raw encoded receive object returned by a transport core.

This is an implementation-boundary trait. Raw encoded receive objects should not implement public frame or lease traits directly; public receive paths expose UWireRx<Rx, W, C> after selected-wire metadata decode and validation.

Required Associated Types§

Source

type PayloadReader<'a>: Read + 'a where Self: 'a

Ordered payload reader type.

Source

type PayloadSlices<'a>: Iterator<Item = &'a [u8]> + 'a where Self: 'a

Ordered payload slices iterator type.

Required Methods§

Source

fn encoded_metadata(&self) -> &[u8]

Returns selected-wire encoded metadata bytes.

Source

fn payload_len(&self) -> usize

Returns the visible application payload length.

Source

fn payload_reader(&self) -> Self::PayloadReader<'_>

Returns an ordered reader over the application payload bytes.

Source

fn payload_slices(&self) -> Self::PayloadSlices<'_>

Returns ordered borrowed payload slices.

Provided Methods§

Source

fn try_contiguous_payload(&self) -> Option<&[u8]>

Returns a contiguous borrowed payload view when available without copying.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§