pub struct Input<'a> { /* private fields */ }
Expand description
A wrapper around &'a [u8]
that helps in writing panic-free code.
No methods of Input
will ever panic.
Intentionally avoids implementing PartialEq
and Eq
to avoid implicit
non-constant-time comparisons.
Implementations§
Source§impl<'a> Input<'a>
impl<'a> Input<'a>
Sourcepub fn read_all<F, R, E>(&self, incomplete_read: E, read: F) -> Result<R, E>
pub fn read_all<F, R, E>(&self, incomplete_read: E, read: F) -> Result<R, E>
Calls read
with the given input as a Reader
, ensuring that read
consumed the entire input. If read
does not consume the entire input,
incomplete_read
is returned.
Sourcepub fn as_slice_less_safe(&self) -> &'a [u8]
pub fn as_slice_less_safe(&self) -> &'a [u8]
Access the input as a slice so it can be processed by functions that are not written using the Input/Reader framework.
Trait Implementations§
Source§impl Debug for Input<'_>
impl Debug for Input<'_>
The value is intentionally omitted from the output to avoid leaking secrets.
impl<'a> Copy 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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes