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

Struct UWireTransport

Source
pub struct UWireTransport<TCore, W, C>
where W: UWire, C: UWireMetadataCodecFor<W>,
{ /* private fields */ }
Expand description

Generic selected-wire transport adapter.

Implementations§

Source§

impl<TCore, W, C> UWireTransport<TCore, W, C>
where W: UWire, C: UWireMetadataCodecFor<W>,

Source

pub fn new(core: TCore, wire: W, metadata_codec: C) -> Self

Creates an adapter around a transport core, selected wire marker, and metadata codec.

Source

pub fn with_wire_and_metadata_codec( core: TCore, wire: W, metadata_codec: C, ) -> Self

Creates an adapter with an explicit selected wire and metadata codec.

Source

pub fn core(&self) -> &TCore

Returns the wrapped physical transport core.

Source

pub fn core_mut(&mut self) -> &mut TCore

Returns the wrapped physical transport core mutably.

Source

pub fn metadata_codec(&self) -> &C

Returns the selected metadata codec.

Source

pub fn into_parts(self) -> (TCore, W, C)

Consumes the adapter and returns the wrapped core, selected wire, and metadata codec.

Trait Implementations§

Source§

impl<TCore, W, C> Debug for UWireTransport<TCore, W, C>
where W: UWire, C: UWireMetadataCodecFor<W>,

Source§

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

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

impl<TCore, W, C> UHasWire for UWireTransport<TCore, W, C>
where W: UWire, C: UWireMetadataCodecFor<W>,

Source§

type Wire = W

Concrete selected wire type.
Source§

fn wire(&self) -> &Self::Wire

Returns the selected wire marker/value.
Source§

impl<TCore, W, C> UOwnedTransportImpl for UWireTransport<TCore, W, C>
where TCore: UOwnedTransportCore, W: UWire + Send + Sync + 'static, C: UWireMetadataCodecFor<W> + Clone + Send + Sync + 'static,

Source§

fn send_validated_owned<'life0, 'async_trait>( &'life0 self, frame: UOwnedFrame, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends an already validated owned frame.
Source§

fn receive_validated_owned<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, source_filter: &'life1 UUri, sink_filter: Option<&'life2 UUri>, ) -> Pin<Box<dyn Future<Output = Result<UOwnedFrame, UStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Receives one matching owned frame from transports that support pull receive.
Source§

fn register_validated_owned_listener<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, source_filter: &'life1 UUri, sink_filter: Option<&'life2 UUri>, listener: Arc<dyn UOwnedListener>, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Registers an owned listener after public filter validation.
Source§

fn unregister_validated_owned_listener<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, source_filter: &'life1 UUri, sink_filter: Option<&'life2 UUri>, listener: Arc<dyn UOwnedListener>, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Unregisters an owned listener after public filter validation.
Source§

impl<TCore, W, C> USelectedWireZeroCopyTransport for UWireTransport<TCore, W, C>
where TCore: UZeroCopyTransportCore, W: UWire + Send + Sync + 'static, C: UWireMetadataCodecFor<W> + Clone + Send + Sync + 'static,

Source§

type MetadataCodec = C

Metadata codec used with the selected wire.
Source§

impl<TCore, W, C> UZeroCopyTransportImpl for UWireTransport<TCore, W, C>
where TCore: UZeroCopyTransportCore, W: UWire + Send + Sync + 'static, C: UWireMetadataCodecFor<W> + Clone + Send + Sync + 'static,

Source§

type Tx = <TCore as UZeroCopyTransportCore>::Tx

Transport-specific transmit loan type.
Source§

type Rx = UWireRx<<TCore as UZeroCopyTransportCore>::Rx, W, C>

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<TCore, W, C> UZeroCopyUninitTransportImpl for UWireTransport<TCore, W, C>
where TCore: UZeroCopyUninitTransportCore, W: UWire + Send + Sync + 'static, C: UWireMetadataCodecFor<W> + Clone + Send + Sync + 'static,

Source§

type UninitTx = <TCore as UZeroCopyUninitTransportCore>::UninitTx

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§

§

impl<TCore, W, C> !Freeze for UWireTransport<TCore, W, C>

§

impl<TCore, W, C> RefUnwindSafe for UWireTransport<TCore, W, C>

§

impl<TCore, W, C> Send for UWireTransport<TCore, W, C>
where TCore: Send, W: Send, C: Send,

§

impl<TCore, W, C> Sync for UWireTransport<TCore, W, C>
where TCore: Sync, W: Sync, C: Sync,

§

impl<TCore, W, C> Unpin for UWireTransport<TCore, W, C>
where TCore: Unpin, W: Unpin, C: Unpin,

§

impl<TCore, W, C> UnwindSafe for UWireTransport<TCore, W, C>
where TCore: UnwindSafe, W: UnwindSafe, C: UnwindSafe,

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> 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, 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<T> UOwnedTransport for T

Source§

fn send_owned<'life0, 'async_trait>( &'life0 self, frame: UOwnedFrame, ) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Sends an owned native frame after public validation.
Source§

fn receive_owned<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, source_filter: &'life1 UUri, sink_filter: Option<&'life2 UUri>, ) -> Pin<Box<dyn Future<Output = Result<UOwnedFrame, UStatus>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, T: 'async_trait,

Receives one matching owned frame from transports that support pull receive.
Source§

fn register_owned_listener<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, source_filter: &'life1 UUri, sink_filter: Option<&'life2 UUri>, listener: Arc<dyn UOwnedListener>, ) -> 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 owned native frames.
Source§

fn unregister_owned_listener<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, source_filter: &'life1 UUri, sink_filter: Option<&'life2 UUri>, listener: Arc<dyn UOwnedListener>, ) -> 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 owned native frames.
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