pub struct ThreadTokens(pub u64);Expand description
A thread’s estimated size in tokens: the UTF-8 bytes of its opening post
and live comments over ThreadTokens::BYTES_PER_TOKEN
Tuple Fields§
§0: u64Implementations§
Source§impl ThreadTokens
impl ThreadTokens
Sourcepub const BYTES_PER_TOKEN: u64 = 4
pub const BYTES_PER_TOKEN: u64 = 4
A rough bytes-per-token ratio for English prose
Sourcepub const fn from_bytes(bytes: u64) -> Self
pub const fn from_bytes(bytes: u64) -> Self
The estimate for a thread whose text is bytes long
Trait Implementations§
Source§impl Clone for ThreadTokens
impl Clone for ThreadTokens
impl Copy for ThreadTokens
Source§impl Debug for ThreadTokens
impl Debug for ThreadTokens
Source§impl Default for ThreadTokens
impl Default for ThreadTokens
impl Eq for ThreadTokens
Source§impl Hash for ThreadTokens
impl Hash for ThreadTokens
Source§impl Ord for ThreadTokens
impl Ord for ThreadTokens
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ThreadTokens
impl PartialEq for ThreadTokens
Source§impl PartialOrd for ThreadTokens
impl PartialOrd for ThreadTokens
impl StructuralPartialEq for ThreadTokens
Auto Trait Implementations§
impl Freeze for ThreadTokens
impl RefUnwindSafe for ThreadTokens
impl Send for ThreadTokens
impl Sync for ThreadTokens
impl Unpin for ThreadTokens
impl UnsafeUnpin for ThreadTokens
impl UnwindSafe for ThreadTokens
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.