pub struct FrameHeader {
pub flags: u8,
pub algorithm: Algorithm,
pub file_id: u32,
pub chunk_index: u64,
pub epoch: u32,
pub raw_len: u32,
pub payload_len: u32,
}Fields§
§flags: u8§algorithm: Algorithm§file_id: u32§chunk_index: u64§epoch: u32Bumped when a chunk is re-encoded, keeping (key, nonce) pairs unique.
raw_len: u32Plaintext length before compression.
payload_len: u32On-wire payload length, excluding the AEAD tag.
Implementations§
Source§impl FrameHeader
impl FrameHeader
pub fn encode(&self, out: &mut [u8; 28])
pub fn decode(buf: &[u8; 28], max_frame: usize) -> Result<Self>
pub fn sealed(&self) -> bool
pub fn last_chunk(&self) -> bool
pub fn is_zero(&self) -> bool
pub fn reuses_local(&self) -> bool
Sourcepub fn wire_payload_len(&self) -> usize
pub fn wire_payload_len(&self) -> usize
Total bytes following the header on the wire.
Trait Implementations§
Source§impl Clone for FrameHeader
impl Clone for FrameHeader
impl Copy for FrameHeader
Source§impl Debug for FrameHeader
impl Debug for FrameHeader
impl Eq for FrameHeader
Source§impl PartialEq for FrameHeader
impl PartialEq for FrameHeader
impl StructuralPartialEq for FrameHeader
Auto Trait Implementations§
impl Freeze for FrameHeader
impl RefUnwindSafe for FrameHeader
impl Send for FrameHeader
impl Sync for FrameHeader
impl Unpin for FrameHeader
impl UnsafeUnpin for FrameHeader
impl UnwindSafe for FrameHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more