pub enum ParamModifier {
Default {
colon: bool,
word: Box<Word>,
},
Assign {
colon: bool,
word: Box<Word>,
},
Alternative {
colon: bool,
word: Box<Word>,
},
Error {
colon: bool,
word: Box<Word>,
},
TrimPrefix {
longest: bool,
pattern: Box<Word>,
},
TrimSuffix {
longest: bool,
pattern: Box<Word>,
},
Substitute {
anchor: SubAnchor,
pattern: Box<Word>,
replacement: Option<Box<Word>>,
},
Substring {
offset: Box<Word>,
length: Option<Box<Word>>,
},
Case(CaseOp),
}Expand description
Modifier operations on parameter values.
Variants§
Default
${name:-word} or ${name-word} — use default.
Assign
${name:=word} or ${name=word} — assign default.
Alternative
${name:+word} or ${name+word} — use alternative.
Error
${name:?word} or ${name?word} — error if unset.
TrimPrefix
${name#pat} or ${name##pat} — remove prefix.
TrimSuffix
${name%pat} or ${name%%pat} — remove suffix.
Substitute
${name/pat/rep} or ${name//pat/rep} — substitution.
Substring
${name:offset} or ${name:offset:length} — substring.
Case(CaseOp)
${name^pat}, ${name^^pat}, ${name,pat}, ${name,,pat}.
Trait Implementations§
Source§impl Clone for ParamModifier
impl Clone for ParamModifier
Source§fn clone(&self) -> ParamModifier
fn clone(&self) -> ParamModifier
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ParamModifier
impl Debug for ParamModifier
Source§impl PartialEq for ParamModifier
impl PartialEq for ParamModifier
impl StructuralPartialEq for ParamModifier
Auto Trait Implementations§
impl Freeze for ParamModifier
impl RefUnwindSafe for ParamModifier
impl Send for ParamModifier
impl Sync for ParamModifier
impl Unpin for ParamModifier
impl UnsafeUnpin for ParamModifier
impl UnwindSafe for ParamModifier
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