pub trait TokenCounter: Send + Sync {
// Required methods
fn count(&self, text: &str) -> usize;
fn backend_name(&self) -> &'static str;
}Expand description
Abstraction over token counting backends.
Required Methods§
Sourcefn backend_name(&self) -> &'static str
fn backend_name(&self) -> &'static str
Return a human-readable name for this backend.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".