pub struct MessageLayout { /* private fields */ }Expand description
Complete length and segment layout for one FLOE message.
Construct this with Parameters::plaintext_layout when the plaintext
length is known, or Parameters::ciphertext_layout when the complete
ciphertext length is known.
Each SegmentLayout supplies the offsets, lengths, position,
and SegmentKind needed by the random-access encryption and
decryption APIs.
Implementations§
Source§impl MessageLayout
impl MessageLayout
Sourcepub fn final_segment(self) -> SegmentLayout
pub fn final_segment(self) -> SegmentLayout
Returns the layout of this message’s final segment.
Sourcepub const fn parameters(self) -> Parameters
pub const fn parameters(self) -> Parameters
Returns the parameter set used by this layout.
Sourcepub const fn plaintext_length(self) -> u64
pub const fn plaintext_length(self) -> u64
Returns the complete plaintext length.
Sourcepub const fn ciphertext_length(self) -> u64
pub const fn ciphertext_length(self) -> u64
Returns the complete ciphertext length, including the FLOE header.
Sourcepub const fn segment_count(self) -> u64
pub const fn segment_count(self) -> u64
Returns the number of segments, including exactly one final segment.
Sourcepub fn segments(self) -> Segments ⓘ
pub fn segments(self) -> Segments ⓘ
Iterates over every segment in position order.
See Self::segment_for_position when accessing an individual
segment by position.
Sourcepub fn segment_for_position(self, position: u64) -> Option<SegmentLayout>
pub fn segment_for_position(self, position: u64) -> Option<SegmentLayout>
Returns the SegmentLayout of position, or None if it is outside this message.
The returned values can be passed directly to the corresponding random-access segment operation.
Trait Implementations§
Source§impl Clone for MessageLayout
impl Clone for MessageLayout
Source§fn clone(&self) -> MessageLayout
fn clone(&self) -> MessageLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more