Skip to main content

PrefixOf

Struct PrefixOf 

Source
struct PrefixOf<'a> {
    prefix_of: &'a [u8],
}
Expand description

Implements [fst::Automaton]

It will match if prefix_of is a prefix of the given data.

Fields§

§prefix_of: &'a [u8]

Implementations§

Source§

impl<'a> PrefixOf<'a>

Source

fn new(prefix_of: &'a [u8]) -> Self

Creates a new PrefixOf from the given slice.

Trait Implementations§

Source§

impl Automaton for PrefixOf<'_>

Source§

type State = usize

The type of the state used in the automaton.
Source§

fn start(&self) -> usize

Returns a single start state for this automaton. Read more
Source§

fn is_match(&self, state: &usize) -> bool

Returns true if and only if state is a match state.
Source§

fn can_match(&self, state: &usize) -> bool

Returns true if and only if state can lead to a match in zero or more steps. Read more
Source§

fn accept(&self, state: &usize, byte: u8) -> usize

Return the next state given state and an input.
§

fn will_always_match(&self, _state: &Self::State) -> bool

Returns true if and only if state matches and must match no matter what steps are taken. Read more
§

fn accept_eof(&self, _: &Self::State) -> Option<Self::State>

If applicable, return the next state when the end of a key is seen.
§

fn starts_with(self) -> StartsWith<Self>
where Self: Sized,

Returns an automaton that matches the strings that start with something this automaton matches.
§

fn union<Rhs>(self, rhs: Rhs) -> Union<Self, Rhs>
where Rhs: Automaton, Self: Sized,

Returns an automaton that matches the strings matched by either this or the other automaton.
§

fn intersection<Rhs>(self, rhs: Rhs) -> Intersection<Self, Rhs>
where Rhs: Automaton, Self: Sized,

Returns an automaton that matches the strings matched by both this and the other automaton.
§

fn complement(self) -> Complement<Self>
where Self: Sized,

Returns an automaton that matches the strings not matched by this automaton.

Auto Trait Implementations§

§

impl<'a> Freeze for PrefixOf<'a>

§

impl<'a> RefUnwindSafe for PrefixOf<'a>

§

impl<'a> Send for PrefixOf<'a>

§

impl<'a> Sync for PrefixOf<'a>

§

impl<'a> Unpin for PrefixOf<'a>

§

impl<'a> UnsafeUnpin for PrefixOf<'a>

§

impl<'a> UnwindSafe for PrefixOf<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoBox<dyn Any> for T
where T: Any,

§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Sync + Send> for T
where T: Any + Send + Sync,

§

fn into_box(self) -> Box<dyn Any + Sync + Send>

Convert self into the appropriate boxed form.
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more