pub struct UWireRx<Rx, W, C>where
W: UWire,{ /* private fields */ }Expand description
Public zero-copy receive lease after selected-wire metadata validation.
Implementations§
Source§impl<Rx, W, C> UWireRx<Rx, W, C>
impl<Rx, W, C> UWireRx<Rx, W, C>
Sourcepub fn try_from_encoded(raw: Rx, codec: &C) -> Result<Self, UStatus>
pub fn try_from_encoded(raw: Rx, codec: &C) -> Result<Self, UStatus>
Decodes metadata from a raw encoded receive object and validates the public frame view.
§Errors
Returns an error if metadata bytes are malformed, selected-wire checks fail, or the resulting public frame view violates transport invariants.
Sourcepub fn into_raw(self) -> Rx
pub fn into_raw(self) -> Rx
Consumes the public wrapper and returns the raw encoded receive object.
Sourcepub fn decode_payload<T>(&self) -> Result<T, UWireError>
pub fn decode_payload<T>(&self) -> Result<T, UWireError>
Decodes this frame’s payload using the selected wire W.
Prefer this selected-wire helper on receive values produced by
explicit selected-wire adapter construction. Use
UFrameView::decode_payload_from_reader_as only for
low-level codec escape hatches.
§Errors
Returns an error if the frame has missing or incompatible payload encoding, has no payload, or if the selected wire cannot decode the payload bytes.
Source§impl<Rx, W, C> UWireRx<Rx, W, C>
impl<Rx, W, C> UWireRx<Rx, W, C>
Sourcepub fn borrow_payload<T>(&self) -> Result<&T, UWireError>
pub fn borrow_payload<T>(&self) -> Result<&T, UWireError>
Borrows this frame’s payload using the selected wire’s payload mapping.
This is the selected-wire true zero-copy receive helper. It requires the raw receive frame to prove that the contiguous payload is loan-backed and requires the selected wire’s mapped codec to support typed borrowing.
§Errors
Returns an error if the frame has no payload, has missing or incompatible
payload encoding, cannot expose one loan-backed contiguous payload, or if
the selected codec cannot borrow T from those bytes.
Trait Implementations§
Source§impl<Rx, W, C> UFrameView for UWireRx<Rx, W, C>
impl<Rx, W, C> UFrameView for UWireRx<Rx, W, C>
Source§type PayloadReader<'a> = <Rx as UEncodedRxFrame>::PayloadReader<'a>
where
Self: 'a
type PayloadReader<'a> = <Rx as UEncodedRxFrame>::PayloadReader<'a> where Self: 'a
Source§type PayloadSlices<'a> = <Rx as UEncodedRxFrame>::PayloadSlices<'a>
where
Self: 'a
type PayloadSlices<'a> = <Rx as UEncodedRxFrame>::PayloadSlices<'a> where Self: 'a
Source§fn metadata(&self) -> &UFrameMetadata
fn metadata(&self) -> &UFrameMetadata
Source§fn payload_len(&self) -> usize
fn payload_len(&self) -> usize
Source§fn has_payload(&self) -> bool
fn has_payload(&self) -> bool
Source§fn payload_reader(&self) -> Self::PayloadReader<'_>
fn payload_reader(&self) -> Self::PayloadReader<'_>
Source§fn payload_slices(&self) -> Self::PayloadSlices<'_>
fn payload_slices(&self) -> Self::PayloadSlices<'_>
Source§fn try_contiguous_payload(&self) -> Option<&[u8]>
fn try_contiguous_payload(&self) -> Option<&[u8]>
Source§fn decode_payload_from_reader_as<C, T>(&self) -> Result<T, UWireError>where
C: PayloadCodec + ReadDecodePayload<T>,
fn decode_payload_from_reader_as<C, T>(&self) -> Result<T, UWireError>where
C: PayloadCodec + ReadDecodePayload<T>,
C. Read moreSource§impl<Rx, W, C> ULoanedContiguousZeroCopyRxFrame for UWireRx<Rx, W, C>
impl<Rx, W, C> ULoanedContiguousZeroCopyRxFrame for UWireRx<Rx, W, C>
Source§fn loaned_contiguous_payload(&self) -> Result<LoanedPayload<'_>, UWireError>
fn loaned_contiguous_payload(&self) -> Result<LoanedPayload<'_>, UWireError>
Source§fn payload_loan_provenance(&self) -> Result<PayloadLoanProvenance, UWireError>
fn payload_loan_provenance(&self) -> Result<PayloadLoanProvenance, UWireError>
Source§fn try_loaned_contiguous_payload(&self) -> Result<&[u8], UWireError>
fn try_loaned_contiguous_payload(&self) -> Result<&[u8], UWireError>
Source§fn borrow_stable_payload<T>(&self) -> Result<&T, UWireError>where
T: StablePayload,
fn borrow_stable_payload<T>(&self) -> Result<&T, UWireError>where
T: StablePayload,
Source§fn borrow_payload_as<C, T>(&self) -> Result<&T, UWireError>where
C: BorrowPayload<T>,
fn borrow_payload_as<C, T>(&self) -> Result<&T, UWireError>where
C: BorrowPayload<T>,
C. Read more