#[non_exhaustive]pub enum InputRequest {
AtLeast {
offset: u64,
min_len: usize,
},
Range(ByteRange),
Len,
}Expand description
What an incremental decoder needs before it can continue.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AtLeast
Bytes from offset on: an input starting there with at least
min_len bytes, or every remaining byte (with total_len set) when
the source ends first. More is welcome. A sequential decoder asks
this way; min_len is the contiguous span it needs to make progress
without copying (one worst-case row, one marker segment).
Fields
Range(ByteRange)
Exactly this span.
Len
The total source length, supplied as Input::total_len.
Implementations§
Source§impl InputRequest
impl InputRequest
Sourcepub const fn at_least(offset: u64, min_len: usize) -> InputRequest
pub const fn at_least(offset: u64, min_len: usize) -> InputRequest
A request for at least min_len bytes from offset.
Sourcepub const fn range(offset: u64, length: u64) -> InputRequest
pub const fn range(offset: u64, length: u64) -> InputRequest
A request for exactly length bytes at offset.
Sourcepub const fn offset(&self) -> Option<u64>
pub const fn offset(&self) -> Option<u64>
The offset this request starts at, if it asks for bytes.
Sourcepub fn is_satisfied_by(&self, input: &Input<'_>) -> bool
pub fn is_satisfied_by(&self, input: &Input<'_>) -> bool
Whether input satisfies this request.
Trait Implementations§
Source§impl Clone for InputRequest
impl Clone for InputRequest
Source§fn clone(&self) -> InputRequest
fn clone(&self) -> InputRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for InputRequest
Source§impl Debug for InputRequest
impl Debug for InputRequest
impl Eq for InputRequest
Source§impl Hash for InputRequest
impl Hash for InputRequest
Source§impl PartialEq for InputRequest
impl PartialEq for InputRequest
impl StructuralPartialEq for InputRequest
Auto Trait Implementations§
impl Freeze for InputRequest
impl RefUnwindSafe for InputRequest
impl Send for InputRequest
impl Sync for InputRequest
impl Unpin for InputRequest
impl UnsafeUnpin for InputRequest
impl UnwindSafe for InputRequest
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