pub struct PreparedTxLoanSpec { /* private fields */ }Expand description
Prepared zero-copy transmit request passed from the adapter to a core.
Implementations§
Source§impl PreparedTxLoanSpec
impl PreparedTxLoanSpec
Sourcepub fn from_validated<W, C>(
spec: UTxLoanSpec,
codec: &C,
) -> Result<Self, UStatus>where
W: UWire,
C: UWireMetadataCodecFor<W>,
pub fn from_validated<W, C>(
spec: UTxLoanSpec,
codec: &C,
) -> Result<Self, UStatus>where
W: UWire,
C: UWireMetadataCodecFor<W>,
Encodes validated metadata for a selected wire.
§Errors
Returns an error if selected-wire metadata encoding fails.
Sourcepub fn from_encoded_parts(
metadata: UFrameMetadata,
encoded_metadata: impl Into<Vec<u8>>,
payload_len: usize,
payload_alignment: usize,
) -> Result<Self, UStatus>
pub fn from_encoded_parts( metadata: UFrameMetadata, encoded_metadata: impl Into<Vec<u8>>, payload_len: usize, payload_alignment: usize, ) -> Result<Self, UStatus>
Creates a prepared loan spec from metadata bytes that are already encoded
for the selected wire associated with metadata.
This is an advanced adapter/core boundary helper for owned-loopback
bridges. Callers must pass encoded_metadata produced by the same
selected wire that will decode metadata on receive; this constructor
validates the decoded metadata and payload layout but cannot prove that
the opaque metadata bytes were produced by a particular wire.
§Errors
Returns an error if metadata, payload presence, or payload alignment is invalid for a zero-copy transmit loan.
Sourcepub fn metadata(&self) -> &UFrameMetadata
pub fn metadata(&self) -> &UFrameMetadata
Returns the decoded frame metadata used to prepare this request.
Sourcepub fn encoded_metadata(&self) -> &[u8] ⓘ
pub fn encoded_metadata(&self) -> &[u8] ⓘ
Returns selected-wire encoded metadata bytes.
Sourcepub fn payload_len(&self) -> usize
pub fn payload_len(&self) -> usize
Returns the visible application payload length requested from the core.
Sourcepub fn payload_alignment(&self) -> usize
pub fn payload_alignment(&self) -> usize
Returns the visible application payload alignment requested from the core.
Sourcepub fn payload_alignment_proof(&self) -> PayloadAlignment
pub fn payload_alignment_proof(&self) -> PayloadAlignment
Returns the validated visible application payload alignment proof.
Sourcepub fn has_payload(&self) -> bool
pub fn has_payload(&self) -> bool
Returns whether the request carries a payload, including a present empty payload.
Sourcepub fn into_parts(self) -> (UFrameMetadata, Vec<u8>, usize, usize)
pub fn into_parts(self) -> (UFrameMetadata, Vec<u8>, usize, usize)
Consumes this request and returns its parts.
Trait Implementations§
Source§impl Clone for PreparedTxLoanSpec
impl Clone for PreparedTxLoanSpec
Source§fn clone(&self) -> PreparedTxLoanSpec
fn clone(&self) -> PreparedTxLoanSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more