Enum patmatch::Chunk [−][src]
A part of a Pattern
.
Used to configure a compiled Pattern.
Variants
Str(String)
A literal string. This matches the string exactly.
A wildcard (usually represented by an asterisk). Matches any amount of characters, including none.
An unknown character (usually represented by a question mark).
Implementations
impl Chunk
[src]
Trait Implementations
impl Clone for Chunk
[src]
impl Debug for Chunk
[src]
impl Eq for Chunk
[src]
impl From<String> for Chunk
[src]
impl FromIterator<Chunk> for Pattern
[src]
fn from_iter<T: IntoIterator<Item = Chunk>>(iter: T) -> Self
[src]
Used to compile a Pattern
from an iterator of Chunk
s.
Note that this allocates memory to store all the Chunk
s.
Example usage:
use patmatch::{Pattern, Chunk}; let chunk_vec = vec![Chunk::str("IMG_"), Chunk::Wildcard, Chunk::str(".png")]; let pat: Pattern = chunk_vec.into_iter().collect(); assert!(pat.matches("IMG_20170301.png")); assert!(!pat.matches("stuff.png")); assert!(!pat.matches("IMG_20170302.jpeg"));
impl PartialEq<Chunk> for Chunk
[src]
impl StructuralEq for Chunk
[src]
impl StructuralPartialEq for Chunk
[src]
Auto Trait Implementations
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnwindSafe for Chunk
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,