pub struct SegmentFraming { /* private fields */ }Expand description
Segment framing information decoded from a FLOE segment prefix.
Construct this with Self::decode. A streaming
decryptor can use Self::ciphertext_length to read the remainder of the
segment and Self::plaintext_length to size an output buffer.
Implementations§
Source§impl SegmentFraming
impl SegmentFraming
Sourcepub fn decode(parameters: Parameters, prefix: [u8; 4]) -> Result<Self>
pub fn decode(parameters: Parameters, prefix: [u8; 4]) -> Result<Self>
Decodes the unauthenticated framing declared by a segment prefix.
This does not authenticate the prefix or the rest of the segment. You must successfully decrypt the segment before trusting it.
§Errors
Returns Error::InvalidCiphertextLength when a final prefix encodes
a length outside the supported range.
Sourcepub const fn ciphertext_length(self) -> usize
pub const fn ciphertext_length(self) -> usize
Returns the complete ciphertext segment length.
Sourcepub const fn plaintext_length(self) -> usize
pub const fn plaintext_length(self) -> usize
Returns the segment’s plaintext payload length.
Sourcepub const fn kind(self) -> SegmentKind
pub const fn kind(self) -> SegmentKind
Returns whether the prefix identifies an internal or final segment.
Trait Implementations§
Source§impl Clone for SegmentFraming
impl Clone for SegmentFraming
Source§fn clone(&self) -> SegmentFraming
fn clone(&self) -> SegmentFraming
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SegmentFraming
Source§impl Debug for SegmentFraming
impl Debug for SegmentFraming
impl Eq for SegmentFraming
Source§impl PartialEq for SegmentFraming
impl PartialEq for SegmentFraming
impl StructuralPartialEq for SegmentFraming
Auto Trait Implementations§
impl Freeze for SegmentFraming
impl RefUnwindSafe for SegmentFraming
impl Send for SegmentFraming
impl Sync for SegmentFraming
impl Unpin for SegmentFraming
impl UnsafeUnpin for SegmentFraming
impl UnwindSafe for SegmentFraming
Blanket Implementations§
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