pub struct ConditionalMultiIndex<'a, K, T> { /* private fields */ }Implementations§
Source§impl<'a, K, T> ConditionalMultiIndex<'a, K, T>
impl<'a, K, T> ConditionalMultiIndex<'a, K, T>
Sourcepub const fn new_ref(
idx_fn: fn(&T, Vec<u8>) -> K,
cond_fn: fn(&T) -> bool,
dese_fn: Option<DeserializeFn<T>>,
pk_namespace: &'a str,
idx_namespace: &'a str,
) -> Self
pub const fn new_ref( idx_fn: fn(&T, Vec<u8>) -> K, cond_fn: fn(&T) -> bool, dese_fn: Option<DeserializeFn<T>>, pk_namespace: &'a str, idx_namespace: &'a str, ) -> Self
Only if result of cond_fn is true, data will be added to this ConditionalMultiIndex.
Result of cond_fn must be constant, otherwise might raise unexpected behavior.
Sourcepub const fn new_owned(
idx_fn: fn(&T, Vec<u8>) -> K,
cond_fn: fn(&T) -> bool,
dese_fn: Option<DeserializeFn<T>>,
pk_namespace: String,
idx_namespace: String,
) -> Self
pub const fn new_owned( idx_fn: fn(&T, Vec<u8>) -> K, cond_fn: fn(&T) -> bool, dese_fn: Option<DeserializeFn<T>>, pk_namespace: String, idx_namespace: String, ) -> Self
Only if result of cond_fn is true, data will be added to this ConditionalMultiIndex.
Result of cond_fn must be constant, otherwise might raise unexpected behavior.
Source§impl<'a, K, T> ConditionalMultiIndex<'a, K, T>
impl<'a, K, T> ConditionalMultiIndex<'a, K, T>
pub fn prefix(&self, p: <K as PrimaryKey<'_>>::Prefix) -> Prefix<T>
pub fn sub_prefix(&self, p: <K as PrimaryKey<'_>>::SubPrefix) -> Prefix<T>
pub fn index_key(&self, k: K) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl<'a, K: Clone, T: Clone> Clone for ConditionalMultiIndex<'a, K, T>
impl<'a, K: Clone, T: Clone> Clone for ConditionalMultiIndex<'a, K, T>
Source§fn clone(&self) -> ConditionalMultiIndex<'a, K, T>
fn clone(&self) -> ConditionalMultiIndex<'a, K, 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<'a, K, T> Index<T> for ConditionalMultiIndex<'a, K, T>
impl<'a, K, T> Index<T> for ConditionalMultiIndex<'a, K, T>
Auto Trait Implementations§
impl<'a, K, T> Freeze for ConditionalMultiIndex<'a, K, T>
impl<'a, K, T> RefUnwindSafe for ConditionalMultiIndex<'a, K, T>
impl<'a, K, T> Send for ConditionalMultiIndex<'a, K, T>
impl<'a, K, T> Sync for ConditionalMultiIndex<'a, K, T>
impl<'a, K, T> Unpin for ConditionalMultiIndex<'a, K, T>
impl<'a, K, T> UnsafeUnpin for ConditionalMultiIndex<'a, K, T>
impl<'a, K, T> UnwindSafe for ConditionalMultiIndex<'a, K, T>
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