pub struct OllamaSnapshot {
pub plan: String,
pub session: Option<UsageWindow>,
pub weekly: Option<UsageWindow>,
pub monthly: Option<UsageWindow>,
pub session_models: Vec<OllamaModelUsage>,
pub weekly_models: Vec<OllamaModelUsage>,
pub monthly_models: Vec<OllamaModelUsage>,
pub activity_cost: Option<String>,
pub activity_period: Option<String>,
}Expand description
Ollama Cloud — the session and weekly usage windows served by
ollama.com/api/usage, plus a per-model breakdown. The response also
carries an activity.cost string for the current period; we keep it raw
(it is already dollar-formatted upstream) and let the renderer place it.
Fields§
§plan: StringDisplay label, taken from the [ollama] plan config field. The API
itself does not report a plan name.
session: Option<UsageWindow>5h rolling window (limits.session). None when the account has not
touched the cloud tier yet (the window is omitted from the response,
not reported as zero).
weekly: Option<UsageWindow>7d rolling window (limits.weekly).
monthly: Option<UsageWindow>Calendar-month window (limits.monthly). Some Pro accounts report
this in place of session/weekly instead of alongside them.
session_models: Vec<OllamaModelUsage>Per-model request counts inside the session window, in the order the API returned them. Renderers sort and truncate this for the tooltip.
weekly_models: Vec<OllamaModelUsage>Per-model request counts inside the weekly window.
monthly_models: Vec<OllamaModelUsage>Per-model request counts inside the monthly window.
activity_cost: Option<String>activity.cost as a pre-formatted dollar string ("0.00000",
"1.23456"). Already a string on the wire — the renderer decides
whether to keep it verbatim or reformat.
activity_period: Option<String>activity.period.type ("last_4_weeks" and friends). A short
human-readable label the renderer can show next to the cost.
Trait Implementations§
Source§impl Clone for OllamaSnapshot
impl Clone for OllamaSnapshot
Source§fn clone(&self) -> OllamaSnapshot
fn clone(&self) -> OllamaSnapshot
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 OllamaSnapshot
impl Debug for OllamaSnapshot
impl Eq for OllamaSnapshot
Source§impl PartialEq for OllamaSnapshot
impl PartialEq for OllamaSnapshot
impl StructuralPartialEq for OllamaSnapshot
Auto Trait Implementations§
impl Freeze for OllamaSnapshot
impl RefUnwindSafe for OllamaSnapshot
impl Send for OllamaSnapshot
impl Sync for OllamaSnapshot
impl Unpin for OllamaSnapshot
impl UnsafeUnpin for OllamaSnapshot
impl UnwindSafe for OllamaSnapshot
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,
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