pub struct StreamReader<R: Read> { /* private fields */ }Expand description
Reads and parses a btrfs send stream.
Implementations§
Source§impl<R: Read> StreamReader<R>
impl<R: Read> StreamReader<R>
Sourcepub fn new(reader: R) -> Result<Self, StreamError>
pub fn new(reader: R) -> Result<Self, StreamError>
Sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Consume the underlying reader back out.
Sourcepub fn next_command(&mut self) -> Result<Option<StreamCommand>, StreamError>
pub fn next_command(&mut self) -> Result<Option<StreamCommand>, StreamError>
Read the next command from the stream.
Returns Ok(None) on clean EOF (no more data), Ok(Some(End)) when
the stream contains an explicit end-of-stream marker.
§Errors
Returns an error on I/O failure, CRC mismatch, malformed TLV attributes, or unknown command types.
§Panics
Panics are unreachable: all unwrap() calls are on fixed-size
slice-to-array conversions that always succeed.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for StreamReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for StreamReader<R>where
R: RefUnwindSafe,
impl<R> Send for StreamReader<R>where
R: Send,
impl<R> Sync for StreamReader<R>where
R: Sync,
impl<R> Unpin for StreamReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for StreamReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for StreamReader<R>where
R: UnwindSafe,
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