pub struct Preamble { /* private fields */ }Implementations§
Source§impl Preamble
impl Preamble
pub fn new(header_len: usize) -> Result<Preamble, FormatError>
Sourcepub fn with_signed(
header_len: usize,
signed: bool,
) -> Result<Preamble, FormatError>
pub fn with_signed( header_len: usize, signed: bool, ) -> Result<Preamble, FormatError>
A signed container sets the critical SIGNED flag, so a reader that does not implement signatures refuses it rather than ignoring the signature.
Sourcepub fn legacy_signed(header_len: usize) -> Result<Preamble, FormatError>
pub fn legacy_signed(header_len: usize) -> Result<Preamble, FormatError>
The HIDE/0.5 form of a signed container. Readers still accept it; only test code writes it, to prove that they do.
Sourcepub fn from_parts(
header_len: usize,
minor: u8,
flags: u8,
) -> Result<Preamble, FormatError>
pub fn from_parts( header_len: usize, minor: u8, flags: u8, ) -> Result<Preamble, FormatError>
Validates exactly as Preamble::decode does.
pub fn header_len(self) -> usize
pub fn minor(self) -> u8
pub fn flags(self) -> u8
pub fn is_signed(self) -> bool
Sourcepub fn is_legacy(self) -> bool
pub fn is_legacy(self) -> bool
A HIDE/0.5–0.8 signed container: legacy transcript, no extensions.
Sourcepub fn signed_prefix(self) -> [u8; 12]
pub fn signed_prefix(self) -> [u8; 12]
Magic, major, minor, kind and flags: everything but the header length, which a signature cannot cover because the signature is in the header.
pub fn encode(self) -> [u8; 16]
pub fn decode(bytes: &[u8]) -> Result<Preamble, FormatError>
Trait Implementations§
impl Copy for Preamble
impl Eq for Preamble
impl StructuralPartialEq for Preamble
Auto Trait Implementations§
impl Freeze for Preamble
impl RefUnwindSafe for Preamble
impl Send for Preamble
impl Sync for Preamble
impl Unpin for Preamble
impl UnsafeUnpin for Preamble
impl UnwindSafe for Preamble
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