Struct yash_syntax::syntax::Trim
source · [−]pub struct Trim {
pub side: TrimSide,
pub length: TrimLength,
pub pattern: Word,
}
Expand description
Parameter expansion modifier that removes the beginning or end of the value being expanded.
Examples of trims include #foo
, ##bar
and %%baz*
.
A trim is composed of a side, length and pattern.
Fields
side: TrimSide
Which side of the value should be removed?
length: TrimLength
How long the pattern should match?
pattern: Word
Pattern to be matched with the expanded value.
Trait Implementations
impl Eq for Trim
impl StructuralEq for Trim
impl StructuralPartialEq for Trim
Auto Trait Implementations
impl !RefUnwindSafe for Trim
impl !Send for Trim
impl !Sync for Trim
impl Unpin for Trim
impl !UnwindSafe for Trim
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more