Struct ZeroAsciiIgnoreCaseTrieCursor
struct ZeroAsciiIgnoreCaseTrieCursor<'a> { ... }
A cursor into a ZeroAsciiIgnoreCaseTrie, useful for stepwise lookup.
For examples, see [ZeroAsciiIgnoreCaseTrie::cursor()].
Implementations
impl ZeroAsciiIgnoreCaseTrieCursor<'_>
fn step(self: &mut Self, byte: u8) -> Option<u8>Steps the cursor one byte into the trie.
Returns the byte if matched, which may be a different case than the input byte. If this function returns
None, any lookup loops can be terminated.Examples
Normalize the case of a value by stepping through an ignore-case trie:
use Cow; use ZeroAsciiIgnoreCaseTrie; // A trie with two values: "aBc" and "aBcdEf" let trie = from_bytes; // Get out the value for "abc" and normalize the key string let mut cursor = trie.cursor; let mut key_str = Borrowed; let mut i = 0; let value = loop ; assert_eq!; assert_eq!;For more examples, see
ZeroTrieSimpleAsciiCursor::step.fn take_value(self: &mut Self) -> Option<usize>Takes the value at the current position.
For more details, see
ZeroTrieSimpleAsciiCursor::take_value.fn probe(self: &mut Self, index: usize) -> Option<AsciiProbeResult>Probes the next byte in the cursor.
For more details, see
ZeroTrieSimpleAsciiCursor::probe.fn is_empty(self: &Self) -> boolChecks whether the cursor points to an empty trie.
For more details, see
ZeroTrieSimpleAsciiCursor::is_empty.
impl Write for ZeroAsciiIgnoreCaseTrieCursor<'_>
fn write_str(self: &mut Self, s: &str) -> ResultSteps the cursor through each ASCII byte of the string.
If the string contains non-ASCII chars, an error is returned.
fn write_char(self: &mut Self, c: char) -> ResultEquivalent to [
ZeroAsciiIgnoreCaseTrieCursor::step()], except returns an error if the char is non-ASCII.
impl<'a> Clone for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn clone(self: &Self) -> ZeroAsciiIgnoreCaseTrieCursor<'a>
impl<'a> Debug for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<'a> Freeze for ZeroAsciiIgnoreCaseTrieCursor<'a>
impl<'a> RefUnwindSafe for ZeroAsciiIgnoreCaseTrieCursor<'a>
impl<'a> Send for ZeroAsciiIgnoreCaseTrieCursor<'a>
impl<'a> Sync for ZeroAsciiIgnoreCaseTrieCursor<'a>
impl<'a> Unpin for ZeroAsciiIgnoreCaseTrieCursor<'a>
impl<'a> UnsafeUnpin for ZeroAsciiIgnoreCaseTrieCursor<'a>
impl<'a> UnwindSafe for ZeroAsciiIgnoreCaseTrieCursor<'a>
impl<T> Any for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for ZeroAsciiIgnoreCaseTrieCursor<'a>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> ErasedDestructor for ZeroAsciiIgnoreCaseTrieCursor<'a>
impl<T> From for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for ZeroAsciiIgnoreCaseTrieCursor<'a>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>