Skip to main content

ParameterExpr

Enum ParameterExpr 

Source
pub enum ParameterExpr {
Show 19 variants Parameter { parameter: Parameter, indirect: bool, }, UseDefaultValues { parameter: Parameter, indirect: bool, test_type: ParameterTestType, default_value: Option<String>, }, AssignDefaultValues { parameter: Parameter, indirect: bool, test_type: ParameterTestType, default_value: Option<String>, }, IndicateErrorIfNullOrUnset { parameter: Parameter, indirect: bool, test_type: ParameterTestType, error_message: Option<String>, }, UseAlternativeValue { parameter: Parameter, indirect: bool, test_type: ParameterTestType, alternative_value: Option<String>, }, ParameterLength { parameter: Parameter, indirect: bool, }, RemoveSmallestSuffixPattern { parameter: Parameter, indirect: bool, pattern: Option<String>, }, RemoveLargestSuffixPattern { parameter: Parameter, indirect: bool, pattern: Option<String>, }, RemoveSmallestPrefixPattern { parameter: Parameter, indirect: bool, pattern: Option<String>, }, RemoveLargestPrefixPattern { parameter: Parameter, indirect: bool, pattern: Option<String>, }, Substring { parameter: Parameter, indirect: bool, offset: UnexpandedArithmeticExpr, length: Option<UnexpandedArithmeticExpr>, }, Transform { parameter: Parameter, indirect: bool, op: ParameterTransformOp, }, UppercaseFirstChar { parameter: Parameter, indirect: bool, pattern: Option<String>, }, UppercasePattern { parameter: Parameter, indirect: bool, pattern: Option<String>, }, LowercaseFirstChar { parameter: Parameter, indirect: bool, pattern: Option<String>, }, LowercasePattern { parameter: Parameter, indirect: bool, pattern: Option<String>, }, ReplaceSubstring { parameter: Parameter, indirect: bool, pattern: String, replacement: Option<String>, match_kind: SubstringMatchKind, }, VariableNames { prefix: String, concatenate: bool, }, MemberKeys { variable_name: String, concatenate: bool, },
}
Expand description

A parameter expression, used in a parameter expansion.

Variants§

§

Parameter

A parameter, with optional indirection.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§

UseDefaultValues

Conditionally use default values.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§test_type: ParameterTestType

The type of test to perform.

§default_value: Option<String>

Default value to conditionally use.

§

AssignDefaultValues

Conditionally assign default values.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§test_type: ParameterTestType

The type of test to perform.

§default_value: Option<String>

Default value to conditionally assign.

§

IndicateErrorIfNullOrUnset

Indicate error if null or unset.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§test_type: ParameterTestType

The type of test to perform.

§error_message: Option<String>

Error message to conditionally yield.

§

UseAlternativeValue

Conditionally use an alternative value.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§test_type: ParameterTestType

The type of test to perform.

§alternative_value: Option<String>

Alternative value to conditionally use.

§

ParameterLength

Compute the length of the given parameter.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§

RemoveSmallestSuffixPattern

Remove the smallest suffix from the given string matching the given pattern.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§pattern: Option<String>

Optionally provides a pattern to match.

§

RemoveLargestSuffixPattern

Remove the largest suffix from the given string matching the given pattern.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§pattern: Option<String>

Optionally provides a pattern to match.

§

RemoveSmallestPrefixPattern

Remove the smallest prefix from the given string matching the given pattern.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§pattern: Option<String>

Optionally provides a pattern to match.

§

RemoveLargestPrefixPattern

Remove the largest prefix from the given string matching the given pattern.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§pattern: Option<String>

Optionally provides a pattern to match.

§

Substring

Extract a substring from the given parameter.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§offset: UnexpandedArithmeticExpr

Arithmetic expression that will be expanded to compute the offset at which the substring should be extracted.

§length: Option<UnexpandedArithmeticExpr>

Optionally provides an arithmetic expression that will be expanded to compute the length of substring to be extracted; if left unspecified, the remainder of the string will be extracted.

§

Transform

Transform the given parameter.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§op: ParameterTransformOp

Type of transformation to apply.

§

UppercaseFirstChar

Uppercase the first character of the given parameter.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§pattern: Option<String>

Optionally provides a pattern to match.

§

UppercasePattern

Uppercase the portion of the given parameter matching the given pattern.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§pattern: Option<String>

Optionally provides a pattern to match.

§

LowercaseFirstChar

Lowercase the first character of the given parameter.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§pattern: Option<String>

Optionally provides a pattern to match.

§

LowercasePattern

Lowercase the portion of the given parameter matching the given pattern.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§pattern: Option<String>

Optionally provides a pattern to match.

§

ReplaceSubstring

Replace occurrences of the given pattern in the given parameter.

Fields

§parameter: Parameter

The parameter.

§indirect: bool

Whether to treat the expanded parameter as an indirect reference, which should be subsequently dereferenced for the expansion.

§pattern: String

Pattern to match.

§replacement: Option<String>

Replacement string.

§match_kind: SubstringMatchKind

Kind of match to perform.

§

VariableNames

Select variable names from the environment with a given prefix.

Fields

§prefix: String

The prefix to match.

§concatenate: bool

Whether to concatenate the results.

§

MemberKeys

Select member keys from the named array.

Fields

§variable_name: String

Name of the array variable.

§concatenate: bool

Whether to concatenate the results.

Trait Implementations§

Source§

impl Clone for ParameterExpr

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParameterExpr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ParameterExpr

Available on crate features serde only.
Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ParameterExpr

Available on crate features serde only.
Source§

impl PartialEq for ParameterExpr

Available on crate features serde only.
Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ParameterExpr

Available on crate features serde only.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ParameterExpr

Available on crate features serde only.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more