Struct smart_read::Input
source · pub struct Input {
pub iter: Box<dyn Iterator<Item = BoxResult<u8>>>,
pub needs_std_flush: bool,
pub should_stop: Option<fn(_: &[u8]) -> bool>,
pub clean_output: Option<fn(_: Vec<u8>) -> Vec<u8>>,
}Expand description
Specifies the source of user input
If should_stop is None, it defaults to stopping once \n is read
If clean_output is None, it defaults to removing a trailing \n (if found) then a trailing \r (if found)
Fields§
§iter: Box<dyn Iterator<Item = BoxResult<u8>>>§needs_std_flush: bool§should_stop: Option<fn(_: &[u8]) -> bool>§clean_output: Option<fn(_: Vec<u8>) -> Vec<u8>>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Input
impl !RefUnwindSafe for Input
impl !Send for Input
impl !Sync for Input
impl Unpin for Input
impl !UnwindSafe for Input
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