pub struct SimpleTokenEstimator;Expand description
A very rough heuristic estimator (bytes / 4).
Trait Implementations§
Source§impl Clone for SimpleTokenEstimator
impl Clone for SimpleTokenEstimator
Source§fn clone(&self) -> SimpleTokenEstimator
fn clone(&self) -> SimpleTokenEstimator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimpleTokenEstimator
impl Debug for SimpleTokenEstimator
Source§impl Default for SimpleTokenEstimator
impl Default for SimpleTokenEstimator
Source§fn default() -> SimpleTokenEstimator
fn default() -> SimpleTokenEstimator
Returns the “default value” for a type. Read more
Source§impl TokenEstimator for SimpleTokenEstimator
impl TokenEstimator for SimpleTokenEstimator
fn estimate_tokens(&self, contents: &[Content]) -> usize
Auto Trait Implementations§
impl Freeze for SimpleTokenEstimator
impl RefUnwindSafe for SimpleTokenEstimator
impl Send for SimpleTokenEstimator
impl Sync for SimpleTokenEstimator
impl Unpin for SimpleTokenEstimator
impl UnsafeUnpin for SimpleTokenEstimator
impl UnwindSafe for SimpleTokenEstimator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more