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 whenever \n is entered
If clean_output is None, it defaults to removing a trailing \n (if found) and 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 !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