pub trait TokenEmbedder {
type EmbeddingSpace;
// Required method
fn embed(token: &str) -> Self::EmbeddingSpace;
}Expand description
A trait for embedding. Implement this to customise the embedding space and function.
Required Associated Types§
Sourcetype EmbeddingSpace
type EmbeddingSpace
The output type of the embedder, i.e., the embedding space.
Required Methods§
Sourcefn embed(token: &str) -> Self::EmbeddingSpace
fn embed(token: &str) -> Self::EmbeddingSpace
Embeds a token into the embedding space.
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.