pub struct Index<T: Translator, V: Eq + Send + Sync, const P: usize> { /* private fields */ }Expand description
A partitioned index that maps translated keys to values. The first P bytes of the
(untranslated) key are used to determine the partition, and the translator is used by the
partition-specific indices on the key after stripping this prefix. The value of P should be
small, typically 1 or 2. Anything larger than 3 will fail to compile.
Implementations§
Trait Implementations§
Source§impl<T: Translator, V: Eq + Send + Sync, const P: usize> Unordered for Index<T, V, P>
impl<T: Translator, V: Eq + Send + Sync, const P: usize> Unordered for Index<T, V, P>
Source§type Cursor<'a> = <Index<T, V> as Unordered>::Cursor<'a>
where
Self: 'a
type Cursor<'a> = <Index<T, V> as Unordered>::Cursor<'a> where Self: 'a
The type of cursor returned by this index to iterate over values with conflicting keys.
Source§fn get<'a>(&'a self, key: &[u8]) -> impl Iterator<Item = &'a Self::Value> + 'awhere
Self::Value: 'a,
fn get<'a>(&'a self, key: &[u8]) -> impl Iterator<Item = &'a Self::Value> + 'awhere
Self::Value: 'a,
Returns an iterator over all values associated with a translated key.
Source§fn get_mut<'a>(&'a mut self, key: &[u8]) -> Option<Self::Cursor<'a>>
fn get_mut<'a>(&'a mut self, key: &[u8]) -> Option<Self::Cursor<'a>>
Provides mutable access to the values associated with a translated key, if the key exists.
Source§fn get_mut_or_insert<'a>(
&'a mut self,
key: &[u8],
value: Self::Value,
) -> Option<Self::Cursor<'a>>
fn get_mut_or_insert<'a>( &'a mut self, key: &[u8], value: Self::Value, ) -> Option<Self::Cursor<'a>>
Provides mutable access to the values associated with a translated key (if the key exists),
otherwise inserts a new value and returns
None.Source§fn insert(&mut self, key: &[u8], value: Self::Value)
fn insert(&mut self, key: &[u8], value: Self::Value)
Inserts a new value at the current position.
Source§fn insert_and_prune(
&mut self,
key: &[u8],
value: Self::Value,
predicate: impl Fn(&Self::Value) -> bool,
)
fn insert_and_prune( &mut self, key: &[u8], value: Self::Value, predicate: impl Fn(&Self::Value) -> bool, )
Insert a value at the given translated key, and prune any values that are no longer valid. Read more
Auto Trait Implementations§
impl<T, V, const P: usize> Freeze for Index<T, V, P>
impl<T, V, const P: usize> RefUnwindSafe for Index<T, V, P>
impl<T, V, const P: usize> Send for Index<T, V, P>
impl<T, V, const P: usize> Sync for Index<T, V, P>
impl<T, V, const P: usize> Unpin for Index<T, V, P>
impl<T, V, const P: usize> UnwindSafe for Index<T, V, P>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more