#[non_exhaustive]pub struct Input<'a> {
pub offset: u64,
pub bytes: &'a [u8],
pub total_len: Option<u64>,
}Expand description
Bytes offered to one step.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.offset: u64Absolute offset of bytes[0] in the source.
bytes: &'a [u8]The bytes. May be empty.
total_len: Option<u64>Total source length, once the driver knows it.
Implementations§
Source§impl<'a> Input<'a>
impl<'a> Input<'a>
Sourcepub const fn new(offset: u64, bytes: &'a [u8]) -> Input<'a>
pub const fn new(offset: u64, bytes: &'a [u8]) -> Input<'a>
bytes located at offset, total length unknown.
Sourcepub const fn with_total_len(self, total_len: u64) -> Input<'a>
pub const fn with_total_len(self, total_len: u64) -> Input<'a>
The same input, carrying the total source length.
Sourcepub const fn with_total_len_opt(self, total_len: Option<u64>) -> Input<'a>
pub const fn with_total_len_opt(self, total_len: Option<u64>) -> Input<'a>
The same input, carrying the total source length if known.
Sourcepub fn reaches_end(&self) -> bool
pub fn reaches_end(&self) -> bool
Whether these bytes run to the end of the source.
Trait Implementations§
impl<'a> Copy for Input<'a>
impl<'a> Eq for Input<'a>
impl<'a> StructuralPartialEq for Input<'a>
Auto Trait Implementations§
impl<'a> Freeze for Input<'a>
impl<'a> RefUnwindSafe for Input<'a>
impl<'a> Send for Input<'a>
impl<'a> Sync for Input<'a>
impl<'a> Unpin for Input<'a>
impl<'a> UnsafeUnpin for Input<'a>
impl<'a> UnwindSafe for Input<'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