Struct CacheError

pub struct CacheError(/* private field */);

An error that occurs when cache usage has become inefficient.

One of the weaknesses of a lazy DFA is that it may need to clear its cache repeatedly if it's not big enough. If this happens too much, then it can slow searching down significantly. A mitigation to this is to use heuristics to detect whether the cache is being used efficiently or not. If not, then a lazy DFA can return a CacheError.

The default configuration of a lazy DFA in this crate is set such that a CacheError will never occur. Instead, callers must opt into this behavior with settings like dfa::Config::minimum_cache_clear_count and dfa::Config::minimum_bytes_per_state.

When the std feature is enabled, this implements the std::error::Error trait.

Trait Implementations

impl Clone for CacheError

fn clone(&self) -> Self

impl Debug for CacheError

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Display for CacheError

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Error for CacheError

Auto Trait Implementations

impl Freeze for CacheError

impl RefUnwindSafe for CacheError

impl Send for CacheError

impl Sync for CacheError

impl Unpin for CacheError

impl UnsafeUnpin for CacheError

impl UnwindSafe for CacheError

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for CacheError where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for CacheError

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for CacheError where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> ToString for CacheError where T: Display + ?Sized,

fn to_string(&self) -> String

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

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, U> TryFrom<U> for CacheError where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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