Skip to main content

HasTokenCount

Trait HasTokenCount 

Source
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§

Source

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".

Implementors§