pub enum Command {
SetVariables(SetVariables),
PrintVariables(PrintVariables),
SetFunctions(SetFunctions),
PrintFunctions(PrintFunctions),
}Expand description
Set of information that defines the behavior of a single invocation of the typeset built-in
The syntax::interpret function returns a value of this type after
parsing the arguments. Call the execute method to perform
the actual operation.
Variants§
SetVariables(SetVariables)
PrintVariables(PrintVariables)
SetFunctions(SetFunctions)
PrintFunctions(PrintFunctions)
Implementations§
Source§impl Command
impl Command
Sourcepub fn execute<S>(
self,
env: &mut Env<S>,
print_context: &PrintContext<'_>,
) -> Result<String, Vec<ExecuteError>>
pub fn execute<S>( self, env: &mut Env<S>, print_context: &PrintContext<'_>, ) -> Result<String, Vec<ExecuteError>>
Executes the command (except for actual printing).
This method updates the shell environment according to the command. If there are no errors, the method returns a string that should be printed to the standard output. Otherwise, the method returns a non-empty vector of errors.
Trait Implementations§
Source§impl From<PrintFunctions> for Command
impl From<PrintFunctions> for Command
Source§fn from(v: PrintFunctions) -> Self
fn from(v: PrintFunctions) -> Self
Converts to this type from the input type.
Source§impl From<PrintVariables> for Command
impl From<PrintVariables> for Command
Source§fn from(v: PrintVariables) -> Self
fn from(v: PrintVariables) -> Self
Converts to this type from the input type.
Source§impl From<SetFunctions> for Command
impl From<SetFunctions> for Command
Source§fn from(v: SetFunctions) -> Self
fn from(v: SetFunctions) -> Self
Converts to this type from the input type.
Source§impl From<SetVariables> for Command
impl From<SetVariables> for Command
Source§fn from(v: SetVariables) -> Self
fn from(v: SetVariables) -> Self
Converts to this type from the input type.
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl !RefUnwindSafe for Command
impl !Send for Command
impl !Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl !UnwindSafe for Command
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> 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