pub struct Echo<'a, 'b, T> { /* private fields */ }Expand description
Input decorator that echoes the input.
This decorator adds the behavior of the verbose shell option to the input. If the option is enabled, the input is echoed to the standard error before it is returned to the caller. Otherwise, the input is returned as is.
Implementations§
Source§impl<'a, 'b, T> Echo<'a, 'b, T>
impl<'a, 'b, T> Echo<'a, 'b, T>
Sourcepub fn new(inner: T, env: &'a RefCell<&'b mut Env>) -> Self
pub fn new(inner: T, env: &'a RefCell<&'b mut Env>) -> Self
Creates a new Echo decorator.
The first argument is the inner Input that performs the actual input
operation. The second argument is the shell environment that contains
the shell option state and the system interface to print to the standard
error. It is wrapped in a RefCell so that it can be shared with other
decorators and the parser.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'b, T> Freeze for Echo<'a, 'b, T>where
T: Freeze,
impl<'a, 'b, T> !RefUnwindSafe for Echo<'a, 'b, T>
impl<'a, 'b, T> !Send for Echo<'a, 'b, T>
impl<'a, 'b, T> !Sync for Echo<'a, 'b, T>
impl<'a, 'b, T> Unpin for Echo<'a, 'b, T>where
T: Unpin,
impl<'a, 'b, T> !UnwindSafe for Echo<'a, 'b, T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InputObject for Twhere
T: Input,
impl<T> InputObject for Twhere
T: Input,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more