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

Struct InMemoryZeroCopyTransport

Source
pub struct InMemoryZeroCopyTransport { /* private fields */ }
Expand description

In-memory zero-copy transport for tests and examples.

Implementations§

Source§

impl InMemoryZeroCopyTransport

Source

pub fn sent_frames(&self) -> Vec<UVecRxLease>

Returns frames sent through UZeroCopyTransport::send_zero_copy.

Source

pub async fn inject(&self, frame: UVecRxLease)

Injects a frame into the receive queue and registered zero-copy listeners.

Trait Implementations§

Source§

impl Clone for InMemoryZeroCopyTransport

Source§

fn clone(&self) -> InMemoryZeroCopyTransport

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InMemoryZeroCopyTransport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InMemoryZeroCopyTransport

Source§

fn default() -> InMemoryZeroCopyTransport

Returns the “default value” for a type. Read more
Source§

impl UZeroCopyTransportImpl for InMemoryZeroCopyTransport

Source§

type Tx = UVecTxBuffer

Transport-specific transmit loan type.
Source§

type Rx = UVecRxLease

Transport-specific receive lease type.
Source§

fn loan_validated_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_validated_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 validated transmit loan.
Source§

fn receive_validated_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_validated_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 zero-copy listener after public filter validation.
Source§

fn unregister_validated_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 zero-copy listener after public filter validation.
Source§

impl UZeroCopyUninitTransportImpl for InMemoryZeroCopyTransport

Source§

type UninitTx = UVecUninitTxBuffer

Transport-specific uninitialized transmit loan type.
Source§

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

Reserves uninitialized transmit storage for a validated frame loan spec.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<TCore> UWithNativePrefixWire for TCore

Source§

fn into_native_prefix_wire_transport<W>( self, wire: W, ) -> UWireTransport<TCore, W, NativePrefixFrameMetadataCodec>
where W: UWire,

Wraps this core with an external or custom selected wire using canonical metadata.
Source§

fn into_protobuf_transport( self, ) -> UWireTransport<TCore, ProtobufWire, NativePrefixFrameMetadataCodec>

Wraps this core with the Protocol Buffers selected-wire profile.
Source§

fn into_stable_container_transport( self, ) -> UWireTransport<TCore, StableContainerWireFormat, NativePrefixFrameMetadataCodec>

Wraps this core with the stable-container selected-wire profile.
Source§

impl<T> UZeroCopyTransport for T

Source§

type Tx = <T as UZeroCopyTransportImpl>::Tx

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

type Rx = <T as UZeroCopyTransportImpl>::Rx

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

fn loan_tx<'life0, 'async_trait>( &'life0 self, spec: UTxLoanSpec, ) -> Pin<Box<dyn Future<Output = Result<<T as UZeroCopyTransport>::Tx, UStatus>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Reserves transmit storage for a validated frame loan spec.
Source§

fn send_zero_copy<'life0, 'async_trait>( &'life0 self, buffer: <T as UZeroCopyTransport>::Tx, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: '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<<T as UZeroCopyTransport>::Rx, UStatus>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, T: '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<<T as UZeroCopyTransport>::Rx>>, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, T: '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<<T as UZeroCopyTransport>::Rx>>, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, T: 'async_trait,

Unregisters a listener for matching zero-copy receive leases.
Source§

impl<T> UZeroCopyTransportExt for T

Source§

fn send_loaned_payload<'life0, 'async_trait, T>( &'life0 self, metadata: UFrameMetadata, init: impl 'async_trait + for<'payload> FnOnce(&'payload mut T) + Send, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: UHasWire + Sync + 'async_trait, Self::Wire: UWirePayload<T>, <Self::Wire as UWirePayload<T>>::Codec: LoanPayload<T> + Send + Sync, T: 'async_trait, 'life0: 'async_trait,

Initializes a typed payload using the adapter’s selected wire and sends it. Read more
Source§

fn send_loaned_payload_as<'life0, 'async_trait, C, T>( &'life0 self, metadata: UFrameMetadata, init: impl 'async_trait + for<'payload> FnOnce(&'payload mut T) + Send, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where C: PayloadCodec + LoanPayload<T> + Send + Sync + 'async_trait, T: 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait,

Initializes a typed payload directly in a transmit loan and sends it. Read more
Source§

impl<T> UZeroCopyUninitTransport for T

Source§

type UninitTx = <T as UZeroCopyUninitTransportImpl>::UninitTx

Transport-specific uninitialized transmit loan type.
Source§

fn loan_uninit_tx<'life0, 'async_trait>( &'life0 self, spec: UTxLoanSpec, ) -> Pin<Box<dyn Future<Output = Result<<T as UZeroCopyUninitTransport>::UninitTx, UStatus>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Reserves uninitialized transmit storage for a validated frame loan spec.
Source§

impl<T> UZeroCopyUninitTransportExt for T

Source§

fn send_uninit_loaned_payload<'life0, 'async_trait, T>( &'life0 self, metadata: UFrameMetadata, init: impl 'async_trait + for<'payload> FnOnce(LoanedUninitPayload<'payload, T>) -> Result<LoanedInitPayload<'payload, T>, UWireError> + Send, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: UHasWire + Sync + 'async_trait, Self::Wire: UWirePayload<T>, <Self::Wire as UWirePayload<T>>::Codec: LoanUninitPayload<T> + Send + Sync, T: Send + 'async_trait, 'life0: 'async_trait,

Constructs a typed payload using the adapter’s selected wire and sends it. Read more
Source§

fn send_uninit_loaned_payload_as<'life0, 'async_trait, C, T>( &'life0 self, metadata: UFrameMetadata, init: impl 'async_trait + for<'payload> FnOnce(LoanedUninitPayload<'payload, T>) -> Result<LoanedInitPayload<'payload, T>, UWireError> + Send, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where C: PayloadCodec + LoanUninitPayload<T> + Send + Sync + 'async_trait, T: Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait,

Constructs a typed payload directly in uninitialized transmit storage and sends it. Read more
Source§

fn send_uninit_stable_payload<'life0, 'async_trait, T>( &'life0 self, metadata: UFrameMetadata, init: impl 'async_trait + for<'payload> FnOnce(StablePayloadInitContext<'payload, T>) -> Result<InitializedStablePayload<'payload, T>, UWireError> + Send, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: UHasWire + Sync + 'async_trait, Self::Wire: UWirePayload<T, Codec = StableContainerPayload<T>>, T: StablePayloadInit + Send + 'async_trait, 'life0: 'async_trait,

Initializes a stable-container payload through the adapter’s selected wire. Read more
Source§

fn send_uninit_stable_payload_as<'life0, 'async_trait, T>( &'life0 self, metadata: UFrameMetadata, init: impl 'async_trait + for<'payload> FnOnce(StablePayloadInitContext<'payload, T>) -> Result<InitializedStablePayload<'payload, T>, UWireError> + Send, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where T: StablePayloadInit + Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait,

Initializes a stable-container payload directly in uninitialized transmit storage. Read more
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more