pub enum CacheLookup<T = CachedMessageRef> {
NotFound,
One(String, T),
Ambiguous(Vec<(String, T)>),
}Expand description
Result of looking up a fragment against the cache.
Generic over the cached entry type so the same enum serves both
MessageCache (default: CachedMessageRef) and EventCache
(CacheLookup<CachedEventRef>).
Variants§
NotFound
One(String, T)
Ambiguous(Vec<(String, T)>)
Two or more entries match the fragment.
The inner vec is capped at 10 entries by find_by_fragment
to keep error messages readable. If more than 10 entries actually match,
only the first 10 are surfaced — callers should ask the user for a
longer fragment rather than try to enumerate all candidates.
Trait Implementations§
Source§impl<T: Clone> Clone for CacheLookup<T>
impl<T: Clone> Clone for CacheLookup<T>
Source§fn clone(&self) -> CacheLookup<T>
fn clone(&self) -> CacheLookup<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for CacheLookup<T>
impl<T: Debug> Debug for CacheLookup<T>
Source§impl<T: PartialEq> PartialEq for CacheLookup<T>
impl<T: PartialEq> PartialEq for CacheLookup<T>
Source§fn eq(&self, other: &CacheLookup<T>) -> bool
fn eq(&self, other: &CacheLookup<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: Eq> Eq for CacheLookup<T>
impl<T> StructuralPartialEq for CacheLookup<T>
Auto Trait Implementations§
impl<T> Freeze for CacheLookup<T>where
T: Freeze,
impl<T> RefUnwindSafe for CacheLookup<T>where
T: RefUnwindSafe,
impl<T> Send for CacheLookup<T>where
T: Send,
impl<T> Sync for CacheLookup<T>where
T: Sync,
impl<T> Unpin for CacheLookup<T>where
T: Unpin,
impl<T> UnsafeUnpin for CacheLookup<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CacheLookup<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.