pub struct Character<'a> { /* private fields */ }Expand description
Character class.
For our case, we do not need to know the exact structure of the character
class, as we’ll score it as a single character anyway, same as *. We also
don’t care whether it’s negated or not, as that doesn’t affect scoring as
well. Therefore, we can just store the string slices.
Trait Implementations§
impl<'a> Eq for Character<'a>
Source§impl<'a> FromIterator<&'a str> for Character<'a>
impl<'a> FromIterator<&'a str> for Character<'a>
impl<'a> StructuralPartialEq for Character<'a>
Source§impl ToSpecificity for Character<'_>
impl ToSpecificity for Character<'_>
Source§fn to_specificity(&self) -> Specificity
fn to_specificity(&self) -> Specificity
Computes the specificity of the character class.
Auto Trait Implementations§
impl<'a> Freeze for Character<'a>
impl<'a> RefUnwindSafe for Character<'a>
impl<'a> Send for Character<'a>
impl<'a> Sync for Character<'a>
impl<'a> Unpin for Character<'a>
impl<'a> UnsafeUnpin for Character<'a>
impl<'a> UnwindSafe for Character<'a>
Blanket Implementations§
impl<T> Arguments for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<K, V> TryAsStorage<K> for V
impl<K, V> TryAsStorage<K> for V
Source§fn try_as_storage(
item: &(dyn Any + 'static),
) -> Result<<V as TryAsStorage<K>>::Target<'_>, Error>
fn try_as_storage( item: &(dyn Any + 'static), ) -> Result<<V as TryAsStorage<K>>::Target<'_>, Error>
Attempts to convert into a storage reference.
§Errors
The following errors might be returned:
Error::Downcast: Item cannot be downcast.
§Examples
use std::any::Any;
use zrx_storage::convert::TryAsStorage;
use zrx_storage::Storage;
// Create storage and initial state
let mut storage = Storage::default();
storage.insert("key", 42);
// Obtain type-erased reference
let item: &dyn Any = &storage;
// Obtain storage reference
let storage = <i32>::try_as_storage(item)?;Source§impl<K, V> TryAsStorageMut<K> for V
impl<K, V> TryAsStorageMut<K> for V
Source§fn try_as_storage_mut(
item: &mut (dyn Any + 'static),
) -> Result<<V as TryAsStorageMut<K>>::Target<'_>, Error>
fn try_as_storage_mut( item: &mut (dyn Any + 'static), ) -> Result<<V as TryAsStorageMut<K>>::Target<'_>, Error>
Attempts to convert into a mutable storage reference.
§Errors
The following errors might be returned:
Error::Downcast: Item cannot be downcast.
§Examples
use std::any::Any;
use zrx_storage::convert::TryAsStorageMut;
use zrx_storage::Storage;
// Create storage and initial state
let mut storage = Storage::default();
storage.insert("key", 42);
// Obtain mutable type-erased reference
let item: &mut dyn Any = &mut storage;
// Obtain mutable storage reference
let storage = <i32>::try_as_storage_mut(item)?;