pub enum Input {
Path(PathBuf),
Stdin,
}
Expand description
An input source for reading.
Variants§
Implementations§
Source§impl Input
impl Input
Sourcepub const ENV_KEY_DISABLE_CHECK: &'static str = "SFS_ALLOW_STDIN"
pub const ENV_KEY_DISABLE_CHECK: &'static str = "SFS_ALLOW_STDIN"
By default, reading an Input
checks that either a path is provided, or that input is
available via stdin, instead of hanging.
In some contexts, e.g. testing, this can cause issues, and so it may be disabled by setting
this environment variable, or by using Input::new_unchecked
.
Sourcepub fn new_unchecked(input: Option<PathBuf>) -> Self
pub fn new_unchecked(input: Option<PathBuf>) -> Self
Creates a new input source without checking that any data is available.
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