pub struct Candidate<'a> { /* private fields */ }Expand description
A candidate path for matching.
All glob matching in this crate operates on Candidate values.
Constructing candidates has a very small cost associated with it, so
callers may find it beneficial to amortize that cost when matching a single
path against multiple globs or sets of globs.
Implementations§
Source§impl<'a> Candidate<'a>
impl<'a> Candidate<'a>
Sourcepub fn new<P: AsRef<Path> + ?Sized>(path: &'a P) -> Candidate<'a>
pub fn new<P: AsRef<Path> + ?Sized>(path: &'a P) -> Candidate<'a>
Create a new candidate for matching from the given path.
Sourcepub fn from_bytes<P: AsRef<[u8]> + ?Sized>(path: &'a P) -> Candidate<'a>
pub fn from_bytes<P: AsRef<[u8]> + ?Sized>(path: &'a P) -> Candidate<'a>
Create a new candidate for matching from the given path as a sequence of bytes.
Generally speaking, this routine expects the bytes to be conventionally UTF-8. It is legal for the byte sequence to contain invalid UTF-8. However, if the bytes are in some other encoding that isn’t ASCII compatible (for example, UTF-16), then the results of matching are unspecified.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Candidate<'a>
impl<'a> RefUnwindSafe for Candidate<'a>
impl<'a> Send for Candidate<'a>
impl<'a> Sync for Candidate<'a>
impl<'a> Unpin for Candidate<'a>
impl<'a> UnwindSafe for Candidate<'a>
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