pub trait HasTokenCount {
// Required method
fn token_count(&self) -> usize;
}Expand description
Trait for types that have a token count field.
Used by select_by_token_budget to generically select items
that fit within a token budget.
Required Methods§
Sourcefn token_count(&self) -> usize
fn token_count(&self) -> usize
Get the token count for this item.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".