pub struct HeuristicTokenCounter;Expand description
Heuristic token counter: bytes / 4.
Trait Implementations§
Source§impl Clone for HeuristicTokenCounter
impl Clone for HeuristicTokenCounter
Source§fn clone(&self) -> HeuristicTokenCounter
fn clone(&self) -> HeuristicTokenCounter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HeuristicTokenCounter
Source§impl Debug for HeuristicTokenCounter
impl Debug for HeuristicTokenCounter
Source§impl Default for HeuristicTokenCounter
impl Default for HeuristicTokenCounter
Source§fn default() -> HeuristicTokenCounter
fn default() -> HeuristicTokenCounter
Returns the “default value” for a type. Read more
Source§impl ItemTokenCounter for HeuristicTokenCounter
impl ItemTokenCounter for HeuristicTokenCounter
Source§fn count_tokens(&self, text: &str) -> usize
fn count_tokens(&self, text: &str) -> usize
Estimate the token count of
text.Auto Trait Implementations§
impl Freeze for HeuristicTokenCounter
impl RefUnwindSafe for HeuristicTokenCounter
impl Send for HeuristicTokenCounter
impl Sync for HeuristicTokenCounter
impl Unpin for HeuristicTokenCounter
impl UnsafeUnpin for HeuristicTokenCounter
impl UnwindSafe for HeuristicTokenCounter
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