pub enum SpecialParam {
At,
Asterisk,
Number,
Question,
Hyphen,
Dollar,
Exclamation,
Zero,
}
Expand description
Special parameter
This enum value identifies a special parameter in the shell language.
Each special parameter is a single character that has a special meaning in
the shell language. For example, @
represents all positional parameters.
See ParamType
for other types of parameters.
Variants§
At
@
(all positional parameters)
Asterisk
*
(all positional parameters)
Number
#
(number of positional parameters)
Question
?
(exit status of the last command)
Hyphen
-
(active shell options)
Dollar
$
(process ID of the shell)
Exclamation
!
(process ID of the last asynchronous command)
Zero
0
(name of the shell or shell script)
Implementations§
Source§impl SpecialParam
impl SpecialParam
Sourcepub const fn from_char(c: char) -> Option<SpecialParam>
pub const fn from_char(c: char) -> Option<SpecialParam>
Returns the special parameter that corresponds to the given character.
If the character does not represent any special parameter, None
is
returned.
Trait Implementations§
Source§impl Clone for SpecialParam
impl Clone for SpecialParam
Source§fn clone(&self) -> SpecialParam
fn clone(&self) -> SpecialParam
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SpecialParam
impl Debug for SpecialParam
Source§impl Display for SpecialParam
impl Display for SpecialParam
Source§impl From<SpecialParam> for Param
Constructs a Param
value representing a special parameter.
impl From<SpecialParam> for Param
Constructs a Param
value representing a special parameter.
Source§fn from(special: SpecialParam) -> Param
fn from(special: SpecialParam) -> Param
Converts to this type from the input type.
Source§impl From<SpecialParam> for ParamType
impl From<SpecialParam> for ParamType
Source§fn from(special: SpecialParam) -> ParamType
fn from(special: SpecialParam) -> ParamType
Converts to this type from the input type.
Source§impl FromStr for SpecialParam
impl FromStr for SpecialParam
Source§type Err = NotSpecialParam
type Err = NotSpecialParam
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<SpecialParam, NotSpecialParam>
fn from_str(s: &str) -> Result<SpecialParam, NotSpecialParam>
Parses a string
s
to return a value of this type. Read moreSource§impl Hash for SpecialParam
impl Hash for SpecialParam
Source§impl PartialEq for SpecialParam
impl PartialEq for SpecialParam
Source§impl TryFrom<char> for SpecialParam
impl TryFrom<char> for SpecialParam
Source§type Error = NotSpecialParam
type Error = NotSpecialParam
The type returned in the event of a conversion error.
Source§fn try_from(c: char) -> Result<SpecialParam, NotSpecialParam>
fn try_from(c: char) -> Result<SpecialParam, NotSpecialParam>
Performs the conversion.
impl Copy for SpecialParam
impl Eq for SpecialParam
impl StructuralPartialEq for SpecialParam
Auto Trait Implementations§
impl Freeze for SpecialParam
impl RefUnwindSafe for SpecialParam
impl Send for SpecialParam
impl Sync for SpecialParam
impl Unpin for SpecialParam
impl UnwindSafe for SpecialParam
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