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 StructuralPartialEq for Trim
Auto Trait Implementations§
impl Freeze for Trim
impl !RefUnwindSafe for Trim
impl !Send for Trim
impl !Sync for Trim
impl Unpin for Trim
impl !UnwindSafe for Trim
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