Skip to main content

VectorIndexes

Struct VectorIndexes 

Source
pub struct VectorIndexes(/* private fields */);
Expand description

A table’s vector registrations. Retained collections own controlled ordered-map nodes and share their names, index handles and original allowance with nested captures. Live mutation requires an explicit fallible borrow; a retained collection never converts itself to an uncharged writable map.

Implementations§

Source§

impl VectorIndexes

Source

pub fn live_mut( &mut self, ) -> StorageBackendResult<&mut BTreeMap<FieldName, Box<dyn VectorIndex>>>

Source

pub fn get<Q: Ord + ?Sized>( &self, field: &Q, ) -> Option<&(dyn VectorIndex + 'static)>
where FieldName: Borrow<Q>,

Source

pub fn contains_key<Q: Ord + ?Sized>(&self, field: &Q) -> bool
where FieldName: Borrow<Q>,

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn iter(&self) -> VectorIndexesIter<'_> ⓘ

Source

pub fn keys(&self) -> impl ExactSizeIterator<Item = &FieldName>

Source

pub fn values( &self, ) -> impl ExactSizeIterator<Item = &(dyn VectorIndex + 'static)>

Source

pub fn capture( source: &dyn VectorIndexSource, control: &StorageReadControl, ) -> StorageBackendResult<Self>

Snapshot live providers under a caller allowance, or share an already retained collection without copying names, nodes or handles. Nested captures preserve the original provider allowance and cancellation boundary.

Trait Implementations§

Source§

impl Default for VectorIndexes

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<BTreeMap<String, Box<dyn VectorIndex>>> for VectorIndexes

Source§

fn from(indexes: BTreeMap<FieldName, Box<dyn VectorIndex>>) -> Self

Converts to this type from the input type.
Source§

impl<Q: Ord + ?Sized> Index<&Q> for VectorIndexes
where FieldName: Borrow<Q>,

Source§

type Output = dyn VectorIndex

The returned type after indexing.
Source§

fn index(&self, field: &Q) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a> IntoIterator for &'a VectorIndexes

Source§

type Item = (&'a String, &'a (dyn VectorIndex + 'static))

The type of the elements being iterated over.
Source§

type IntoIter = VectorIndexesIter<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl VectorIndexSource for VectorIndexes

Source§

fn visit( &self, visitor: &mut dyn FnMut(&str, &dyn VectorIndex) -> StorageBackendResult<()>, ) -> StorageBackendResult<()>

Source§

fn retained_collection(&self) -> StorageBackendResult<Option<VectorIndexes>>

An immutable collection may share its original allocation owner. Implementations must never capture or clone a live collection here.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.