pub struct InMemoryZeroCopyTransport { /* private fields */ }Expand description
In-memory zero-copy transport for tests and examples.
Implementations§
Source§impl InMemoryZeroCopyTransport
impl InMemoryZeroCopyTransport
Sourcepub fn sent_frames(&self) -> Vec<UVecRxLease>
pub fn sent_frames(&self) -> Vec<UVecRxLease>
Returns frames sent through UZeroCopyTransport::send_zero_copy.
Sourcepub async fn inject(&self, frame: UVecRxLease)
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
impl Clone for InMemoryZeroCopyTransport
Source§fn clone(&self) -> InMemoryZeroCopyTransport
fn clone(&self) -> InMemoryZeroCopyTransport
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryZeroCopyTransport
impl Debug for InMemoryZeroCopyTransport
Source§impl Default for InMemoryZeroCopyTransport
impl Default for InMemoryZeroCopyTransport
Source§fn default() -> InMemoryZeroCopyTransport
fn default() -> InMemoryZeroCopyTransport
Returns the “default value” for a type. Read more
Source§impl UZeroCopyTransportImpl for InMemoryZeroCopyTransport
impl UZeroCopyTransportImpl for InMemoryZeroCopyTransport
Source§type Tx = UVecTxBuffer
type Tx = UVecTxBuffer
Transport-specific transmit loan type.
Source§type Rx = UVecRxLease
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,
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,
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,
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,
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,
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
impl UZeroCopyUninitTransportImpl for InMemoryZeroCopyTransport
Source§type UninitTx = UVecUninitTxBuffer
type UninitTx = UVecUninitTxBuffer
Transport-specific uninitialized transmit loan type.
Auto Trait Implementations§
impl Freeze for InMemoryZeroCopyTransport
impl RefUnwindSafe for InMemoryZeroCopyTransport
impl Send for InMemoryZeroCopyTransport
impl Sync for InMemoryZeroCopyTransport
impl Unpin for InMemoryZeroCopyTransport
impl UnwindSafe for InMemoryZeroCopyTransport
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<TCore> UWithNativePrefixWire for TCore
impl<TCore> UWithNativePrefixWire for TCore
Source§fn into_native_prefix_wire_transport<W>(
self,
wire: W,
) -> UWireTransport<TCore, W, NativePrefixFrameMetadataCodec>where
W: UWire,
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>
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>
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 Twhere
T: UZeroCopyTransportImpl + ?Sized,
impl<T> UZeroCopyTransport for Twhere
T: UZeroCopyTransportImpl + ?Sized,
Source§type Tx = <T as UZeroCopyTransportImpl>::Tx
type Tx = <T as UZeroCopyTransportImpl>::Tx
Transport-specific transmit loan type returned by
Self::loan_tx.Source§type Rx = <T as UZeroCopyTransportImpl>::Rx
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,
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,
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,
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,
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,
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 Twhere
T: UZeroCopyTransport + ?Sized,
impl<T> UZeroCopyTransportExt for Twhere
T: UZeroCopyTransport + ?Sized,
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,
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,
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 Twhere
T: UZeroCopyUninitTransportImpl + ?Sized,
impl<T> UZeroCopyUninitTransport for Twhere
T: UZeroCopyUninitTransportImpl + ?Sized,
Source§type UninitTx = <T as UZeroCopyUninitTransportImpl>::UninitTx
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,
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 Twhere
T: UZeroCopyUninitTransport + ?Sized,
impl<T> UZeroCopyUninitTransportExt for Twhere
T: UZeroCopyUninitTransport + ?Sized,
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,
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,
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,
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>>
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>>
Initializes a stable-container payload directly in uninitialized transmit storage. Read more