pub trait VsaBackend {
type Vector: Clone + Send + Sync + 'static;
// Required methods
fn zero(&self) -> Self::Vector;
fn bundle(&self, a: &Self::Vector, b: &Self::Vector) -> Self::Vector;
fn bind(&self, a: &Self::Vector, b: &Self::Vector) -> Self::Vector;
fn cosine(&self, a: &Self::Vector, b: &Self::Vector) -> f64;
fn encode_data(
&self,
data: &[u8],
config: &ReversibleVSAConfig,
path: Option<&str>,
) -> Self::Vector;
fn decode_data(
&self,
vec: &Self::Vector,
config: &ReversibleVSAConfig,
path: Option<&str>,
expected_size: usize,
) -> Vec<u8> ⓘ;
}Expand description
Backend-agnostic VSA operations exposed to a kernel/runtime.
This is intentionally small: it captures the stable semantic contract while allowing internal representation changes (e.g., migration to ternary-native packed vectors).