Skip to main content

Embedding

Trait Embedding 

Source
pub trait Embedding:
    'static
    + Clone
    + Hash
    + PartialEq
    + Eq
    + Debug
    + Display
    + EmbeddingProtoConvert {
    type Scalar: 'static + Copy + Clone + Send + Sync;

    // Required methods
    fn length() -> usize;
    fn as_slice(&self) -> &[Self::Scalar];
    fn from_slice(data: &[Self::Scalar]) -> Self;
    fn zeros() -> Self;
}
Expand description

A fixed-dimensionality embedding vector.

Required Associated Types§

Source

type Scalar: 'static + Copy + Clone + Send + Sync

Required Methods§

Source

fn length() -> usize

Source

fn as_slice(&self) -> &[Self::Scalar]

Source

fn from_slice(data: &[Self::Scalar]) -> Self

Source

fn zeros() -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§