pub struct GlobPattern { /* private fields */ }Expand description
A validated glob pattern (PATH-009..PATH-016).
The canonical body is stored as a string without the leading
/; the leading / is reintroduced by fmt::Display when
the anchor is workspace-absolute. This keeps Eq/Hash keyed
on a single canonical spelling.
Implementations§
Source§impl GlobPattern
impl GlobPattern
Sourcepub fn anchor(&self) -> PathAnchor
pub fn anchor(&self) -> PathAnchor
The anchor (workspace-absolute or project-relative).
Sourcepub fn compile(&self) -> Glob
pub fn compile(&self) -> Glob
Compile this pattern into a globset::Glob for matching.
The pattern was validated at construction, so compilation always succeeds.
§Panics
Does not panic on any path of execution reachable from valid
input: an internal invariant assertion exists (the success
of globset::GlobBuilder::build after the same builder
already accepted the pattern at parse time) but is
structurally unreachable.
Trait Implementations§
Source§impl Clone for GlobPattern
impl Clone for GlobPattern
Source§fn clone(&self) -> GlobPattern
fn clone(&self) -> GlobPattern
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 GlobPattern
impl Debug for GlobPattern
Source§impl Display for GlobPattern
impl Display for GlobPattern
Source§impl Hash for GlobPattern
impl Hash for GlobPattern
Source§impl PartialEq for GlobPattern
impl PartialEq for GlobPattern
Source§fn eq(&self, other: &GlobPattern) -> bool
fn eq(&self, other: &GlobPattern) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for GlobPattern
impl StructuralPartialEq for GlobPattern
Auto Trait Implementations§
impl Freeze for GlobPattern
impl RefUnwindSafe for GlobPattern
impl Send for GlobPattern
impl Sync for GlobPattern
impl Unpin for GlobPattern
impl UnsafeUnpin for GlobPattern
impl UnwindSafe for GlobPattern
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