Enum Demand
pub enum Demand {
Bytes(usize),
Stop,
}Available on crate feature
alloc only.Expand description
Describes what the I/O layer should do next.
Variants§
Bytes(usize)
Read len bytes and pass them to JournalReader::feed.
len never exceeds the reader’s configured maximum frame length (see
JournalReader::with_max_frame_len); a header declaring a larger
frame is reported as Step::Corrupt instead of demanded.
If the source returns fewer bytes than requested:
- When
JournalReader::is_frame_boundaryistrueand zero bytes are read, the stream ended cleanly. - Otherwise, the tail is truncated/corrupt; truncate the source to
JournalReader::bytes_consumed.
Stop
The reader is finished and will not accept any more bytes (it
previously detected corruption). Truncate the source to
JournalReader::bytes_consumed.
Trait Implementations§
impl Copy for Demand
impl Eq for Demand
impl StructuralPartialEq for Demand
Auto Trait Implementations§
impl Freeze for Demand
impl RefUnwindSafe for Demand
impl Send for Demand
impl Sync for Demand
impl Unpin for Demand
impl UnwindSafe for Demand
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