pub struct ArchiveParser { /* private fields */ }Expand description
Incremental archive parser: ArchiveParser::feed it byte pieces of any
size, then drain ArchiveParser::next_event until it returns None
(more input needed). Call ArchiveParser::finish after the last feed
to catch truncated streams. Buffered bytes are zeroized on drop.
Implementations§
Source§impl ArchiveParser
impl ArchiveParser
pub fn new() -> Self
pub fn feed(&mut self, bytes: &[u8])
Sourcepub fn next_event(&mut self) -> Result<Option<ArchiveEvent>, ArchiveError>
pub fn next_event(&mut self) -> Result<Option<ArchiveEvent>, ArchiveError>
Returns the next event, or None when more input is needed.
Sourcepub fn finish(&self) -> Result<(), ArchiveError>
pub fn finish(&self) -> Result<(), ArchiveError>
Verifies the stream ended cleanly: terminator seen, no bytes left.
Auto Trait Implementations§
impl Freeze for ArchiveParser
impl RefUnwindSafe for ArchiveParser
impl Send for ArchiveParser
impl Sync for ArchiveParser
impl Unpin for ArchiveParser
impl UnsafeUnpin for ArchiveParser
impl UnwindSafe for ArchiveParser
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