Struct untrusted::Input [−][src]
pub struct Input<'a> { /* fields omitted */ }
Expand description
A wrapper around &'a [u8]
that helps in writing panic-free code.
No methods of Input
will ever panic.
Implementations
impl<'a> Input<'a>
[src]
impl<'a> Input<'a>
[src]pub fn read_all<F, R, E>(&self, incomplete_read: E, read: F) -> Result<R, E> where
F: FnOnce(&mut Reader<'a>) -> Result<R, E>,
[src]
pub fn read_all<F, R, E>(&self, incomplete_read: E, read: F) -> Result<R, E> where
F: FnOnce(&mut Reader<'a>) -> Result<R, E>,
[src]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.
pub fn as_slice_less_safe(&self) -> &'a [u8]
[src]
pub fn as_slice_less_safe(&self) -> &'a [u8]
[src]Access the input as a slice so it can be processed by functions that are not written using the Input/Reader framework.