pub struct RouteLimits {
pub context_tokens: Option<u64>,
pub input_tokens: Option<u64>,
pub output_tokens: Option<u64>,
}Expand description
Token limits for one resolved route/offering.
These are optional because hosted catalogs, local runtimes, and custom
endpoints can legitimately omit some or all limit facts. Callers should
treat None as unknown, not zero.
Fields§
§context_tokens: Option<u64>Total context window (input + output), in tokens.
input_tokens: Option<u64>Input-token limit, when the provider reports it separately.
output_tokens: Option<u64>Output-token cap for the route/offering, when known.
Implementations§
Source§impl RouteLimits
impl RouteLimits
Sourcepub const fn has_known_limit(self) -> bool
pub const fn has_known_limit(self) -> bool
Whether at least one limit fact is known.
Trait Implementations§
Source§impl Clone for RouteLimits
impl Clone for RouteLimits
Source§fn clone(&self) -> RouteLimits
fn clone(&self) -> RouteLimits
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 RouteLimits
Source§impl Debug for RouteLimits
impl Debug for RouteLimits
Source§impl Default for RouteLimits
impl Default for RouteLimits
Source§fn default() -> RouteLimits
fn default() -> RouteLimits
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RouteLimits
impl<'de> Deserialize<'de> for RouteLimits
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 RouteLimits
Source§impl From<&ModelsDevLimit> for RouteLimits
impl From<&ModelsDevLimit> for RouteLimits
Source§fn from(limit: &ModelsDevLimit) -> Self
fn from(limit: &ModelsDevLimit) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RouteLimits
impl PartialEq for RouteLimits
Source§impl Serialize for RouteLimits
impl Serialize for RouteLimits
impl StructuralPartialEq for RouteLimits
Auto Trait Implementations§
impl Freeze for RouteLimits
impl RefUnwindSafe for RouteLimits
impl Send for RouteLimits
impl Sync for RouteLimits
impl Unpin for RouteLimits
impl UnsafeUnpin for RouteLimits
impl UnwindSafe for RouteLimits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.