pub struct UTxLoanSpec<S = Validated> { /* private fields */ }Expand description
Validated transport-independent transmit loan specification.
Implementations§
Source§impl UTxLoanSpec<Validated>
impl UTxLoanSpec<Validated>
Sourcepub fn no_payload(metadata: UFrameMetadata) -> Result<Self, UStatus>
pub fn no_payload(metadata: UFrameMetadata) -> Result<Self, UStatus>
Creates a no-payload transmit loan spec.
§Errors
Returns an error if the metadata is invalid or still carries payload encoding.
Sourcepub fn payload(
metadata: UFrameMetadata,
payload_len: usize,
alignment: usize,
) -> Result<Self, UStatus>
pub fn payload( metadata: UFrameMetadata, payload_len: usize, alignment: usize, ) -> Result<Self, UStatus>
Creates a present-payload transmit loan spec.
§Errors
Returns an error if metadata is invalid, has no payload encoding, or if the requested payload alignment is invalid.
Sourcepub fn present_empty_payload(metadata: UFrameMetadata) -> Result<Self, UStatus>
pub fn present_empty_payload(metadata: UFrameMetadata) -> Result<Self, UStatus>
Creates a present-empty-payload transmit loan spec.
§Errors
Returns an error if the metadata is invalid or has no payload encoding.
Source§impl UTxLoanSpec<Unvalidated>
impl UTxLoanSpec<Unvalidated>
Sourcepub fn new_unchecked(metadata: UFrameMetadata, payload: UTxPayloadSpec) -> Self
pub fn new_unchecked(metadata: UFrameMetadata, payload: UTxPayloadSpec) -> Self
Creates a transmit loan spec without validation.
Source§impl<S> UTxLoanSpec<S>
impl<S> UTxLoanSpec<S>
Sourcepub fn metadata(&self) -> &UFrameMetadata
pub fn metadata(&self) -> &UFrameMetadata
Returns the immutable frame metadata associated with this loan.
Sourcepub fn into_metadata(self) -> UFrameMetadata
pub fn into_metadata(self) -> UFrameMetadata
Consumes the spec and returns its metadata.
Sourcepub fn payload_spec(&self) -> UTxPayloadSpec
pub fn payload_spec(&self) -> UTxPayloadSpec
Returns the payload presence and layout spec.
Sourcepub fn has_payload(&self) -> bool
pub fn has_payload(&self) -> bool
Returns whether the transmit frame carries a payload.
Sourcepub fn payload_len(&self) -> usize
pub fn payload_len(&self) -> usize
Returns the visible application payload length.
Sourcepub fn payload_alignment(&self) -> usize
pub fn payload_alignment(&self) -> usize
Returns the requested visible application payload alignment.
Sourcepub fn payload_alignment_proof(&self) -> PayloadAlignment
pub fn payload_alignment_proof(&self) -> PayloadAlignment
Returns the validated payload alignment proof.
Trait Implementations§
Source§impl<S: Clone> Clone for UTxLoanSpec<S>
impl<S: Clone> Clone for UTxLoanSpec<S>
Source§fn clone(&self) -> UTxLoanSpec<S>
fn clone(&self) -> UTxLoanSpec<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more