Skip to main content

TokenEstimator

Trait TokenEstimator 

Source
pub trait TokenEstimator: Send + Sync {
    // Required method
    fn estimate_tokens(&self, text: &str) -> usize;
}

Required Methods§

Source

fn estimate_tokens(&self, text: &str) -> usize

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§