#[non_exhaustive]pub enum Segment {
Literal(String),
Wildcard,
Partial {
prefix: String,
suffix: String,
},
Globstar,
}Expand description
One segment of a Pattern.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Literal(String)
Matches exactly this segment. Never empty, and never contains / or *.
Wildcard
*: matches any one segment.
Partial
prefix*suffix: matches any one segment that starts with prefix and ends
with suffix, without the two overlapping. Either may be empty, not both.
Fields
Globstar
**: matches any run of zero or more segments. At most one per pattern.
Trait Implementations§
impl Eq for Segment
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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