pub struct Bundle<'a> { /* private fields */ }Expand description
A validated bundle: a handle onto the buffer it was parsed from.
Holding one is the proof that every check in this module passed, which
is why walking it with iter cannot fail.
Implementations§
Source§impl<'a> Bundle<'a>
impl<'a> Bundle<'a>
Sourcepub fn parse(format: &Format, bytes: &'a [u8]) -> Result<Bundle<'a>, Error>
pub fn parse(format: &Format, bytes: &'a [u8]) -> Result<Bundle<'a>, Error>
Checks bytes against format and returns a handle to it.
Allocates nothing: the result borrows the buffer.
§Order of checks
The checksum is verified before any entry is walked. A transfer that lost bytes produces lengths that still look plausible, and reporting the first one that happens not to fit describes a symptom rather than what went wrong.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Bundle<'a>
impl<'a> RefUnwindSafe for Bundle<'a>
impl<'a> Send for Bundle<'a>
impl<'a> Sync for Bundle<'a>
impl<'a> Unpin for Bundle<'a>
impl<'a> UnsafeUnpin for Bundle<'a>
impl<'a> UnwindSafe for Bundle<'a>
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