pub struct RequestUsageConfig {
pub include: bool,
}Expand description
OpenRouter’s request-side “return detailed usage” directive.
Why: requesting detailed usage accounting is what makes OpenRouter return its
authoritative, cache-discount-aware usage.cost and nested cache counters —
without it only the bare token counts are guaranteed. Sent only for the
OpenRouter provider (gated by super::super::adapter::InferenceAdapter::wants_detailed_usage).
What: include: true serialises to {"include":true} under the request’s
top-level usage key.
Test: request_usage_detailed_shape.
Fields§
§include: boolWhether to request detailed (cost + cache-breakdown) usage accounting.
Implementations§
Source§impl RequestUsageConfig
impl RequestUsageConfig
Sourcepub fn detailed() -> RequestUsageConfig
pub fn detailed() -> RequestUsageConfig
Construct the “include detailed usage” directive.
Why: every call site wants the identical {"include":true} value.
What: returns RequestUsageConfig { include: true }.
Test: request_usage_detailed_shape.
Trait Implementations§
Source§impl Clone for RequestUsageConfig
impl Clone for RequestUsageConfig
Source§fn clone(&self) -> RequestUsageConfig
fn clone(&self) -> RequestUsageConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RequestUsageConfig
impl Debug for RequestUsageConfig
Source§impl<'de> Deserialize<'de> for RequestUsageConfig
impl<'de> Deserialize<'de> for RequestUsageConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RequestUsageConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RequestUsageConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for RequestUsageConfig
Source§impl PartialEq for RequestUsageConfig
impl PartialEq for RequestUsageConfig
Source§impl Serialize for RequestUsageConfig
impl Serialize for RequestUsageConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for RequestUsageConfig
Auto Trait Implementations§
impl Freeze for RequestUsageConfig
impl RefUnwindSafe for RequestUsageConfig
impl Send for RequestUsageConfig
impl Sync for RequestUsageConfig
impl Unpin for RequestUsageConfig
impl UnsafeUnpin for RequestUsageConfig
impl UnwindSafe for RequestUsageConfig
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more