pub struct RequestEstimate { /* private fields */ }Expand description
Categorized estimate. Total derives from categories instead of being a separately mutable field that could drift from them.
Implementations§
Source§impl RequestEstimate
impl RequestEstimate
pub fn method(&self) -> ByteEstimator
pub fn sources(&self) -> &[SourceEstimate]
pub fn total_tokens(&self) -> u64
pub fn tokens_for(&self, source: &ContentSource) -> u64
Trait Implementations§
Source§impl Clone for RequestEstimate
impl Clone for RequestEstimate
Source§fn clone(&self) -> RequestEstimate
fn clone(&self) -> RequestEstimate
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 moreSource§impl Debug for RequestEstimate
impl Debug for RequestEstimate
Source§impl<'de> Deserialize<'de> for RequestEstimate
impl<'de> Deserialize<'de> for RequestEstimate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RequestEstimate
Source§impl JsonSchema for RequestEstimate
impl JsonSchema for RequestEstimate
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for RequestEstimate
impl PartialEq for RequestEstimate
Source§fn eq(&self, other: &RequestEstimate) -> bool
fn eq(&self, other: &RequestEstimate) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RequestEstimate
impl Serialize for RequestEstimate
impl StructuralPartialEq for RequestEstimate
Auto Trait Implementations§
impl Freeze for RequestEstimate
impl RefUnwindSafe for RequestEstimate
impl Send for RequestEstimate
impl Sync for RequestEstimate
impl Unpin for RequestEstimate
impl UnsafeUnpin for RequestEstimate
impl UnwindSafe for RequestEstimate
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