Struct Index
pub struct Index<T, K> {
pub position: usize,
pub name: &'static str,
/* private fields */
}Expand description
A handle to one of T’s secondary indexes, naming the field it covers and
the type of that field.
#[derive(Mvcc)] emits one of these as an associated const per indexed
field, named after the field in upper case — #[mvcc(index)] owner: u64
becomes Item::OWNER: Index<Item, u64>. Scans take the const rather than a
name and a range, so both are checked at compile time: a wrong name is an
unresolved item, and a range whose type does not match the indexed field
fails to unify with K instead of silently matching nothing.
It is Copy and holds only a position, so passing one costs nothing.
Fields§
§position: usizePosition in Versioned::indexes.
name: &'static strThe indexed field’s name, for diagnostics.
Trait Implementations§
Auto Trait Implementations§
impl<T, K> Freeze for Index<T, K>
impl<T, K> RefUnwindSafe for Index<T, K>
impl<T, K> Send for Index<T, K>
impl<T, K> Sync for Index<T, K>
impl<T, K> Unpin for Index<T, K>
impl<T, K> UnsafeUnpin for Index<T, K>
impl<T, K> UnwindSafe for Index<T, K>
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