Skip to main content

VectorIndex

Trait VectorIndex 

Source
pub trait VectorIndex:
    Sized
    + Debug
    + Clone {
    type C: Context;

    // Required methods
    fn context(&self) -> &Self::C;
    fn zeros(len: IndexType, ctx: Self::C) -> Self;
    fn len(&self) -> IndexType;
    fn clone_as_vec(&self) -> Vec<IndexType> ;
    fn from_vec(v: Vec<IndexType>, ctx: Self::C) -> Self;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A trait for types that represent a collection of indices into a vector.

This is used to represent subsets of vector elements, typically for algebraic constraints or when operating on specific vector components.

Required Associated Types§

Required Methods§

Source

fn context(&self) -> &Self::C

Source

fn zeros(len: IndexType, ctx: Self::C) -> Self

Source

fn len(&self) -> IndexType

Source

fn clone_as_vec(&self) -> Vec<IndexType>

Source

fn from_vec(v: Vec<IndexType>, ctx: Self::C) -> Self

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§