Struct regex_automata::hybrid::error::CacheError
source · pub struct CacheError(());
Expand description
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.
Tuple Fields§
§0: ()
Implementations§
source§impl CacheError
impl CacheError
pub(crate) fn too_many_cache_clears() -> CacheError
pub(crate) fn bad_efficiency() -> CacheError
Trait Implementations§
source§impl Clone for CacheError
impl Clone for CacheError
source§fn clone(&self) -> CacheError
fn clone(&self) -> CacheError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CacheError
impl Debug for CacheError
source§impl Display for CacheError
impl Display for CacheError
source§impl Error for CacheError
impl Error for CacheError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for CacheError
impl RefUnwindSafe for CacheError
impl Send for CacheError
impl Sync for CacheError
impl Unpin for CacheError
impl UnwindSafe for CacheError
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