[][src]Struct sonnerie::wildcard::Wildcard

pub struct Wildcard { /* fields omitted */ }

matches % as a wildcard operator

Implementations

impl Wildcard[src]

pub fn new(w: &str) -> Wildcard[src]

Parse a wildcard filter. All strings are valid, so never fails.

pub fn prefix(&self) -> &str[src]

Returns the shortest possible fixed prefix.

If no "%" is in the filter, then the entire string is returned, Otherwise everything up to the "%" is returned, which may be an empty string.

pub fn is_exact(&self) -> bool[src]

returns true if this search can only match a single key.

This only happens when there is no "%" in the filter.

pub fn as_regex(&self) -> Option<Regex>[src]

Returns the regex that matches my wildcard.

Returns None if the prefix is all that's needed, even if it's still a wildcard.

"prefix%suffix" returns Some but prefix% returns None.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,