Skip to main content

DeepRelaySnapshot

Struct DeepRelaySnapshot 

Source
pub struct DeepRelaySnapshot {
Show 17 fields pub plan: String, pub plan_price_cents: Option<i64>, pub plan_interval: Option<String>, pub subscribed: bool, pub cancel_at_period_end: bool, pub monthly_input: Option<DeepRelayMeter>, pub monthly_output: Option<DeepRelayMeter>, pub weekly_input: Option<DeepRelayMeter>, pub weekly_output: Option<DeepRelayMeter>, pub backstop_used_usd: Option<f64>, pub backstop_limit_usd: Option<f64>, pub searches: Option<(u64, u64)>, pub payg_calls_24h: Option<u64>, pub balance_usd: Option<f64>, pub period_start: Option<DateTime<Utc>>, pub period_end: Option<DateTime<Utc>>, pub models: Vec<DeepRelayModelUsage>,
}
Expand description

DeepRelay — a monthly plan with four weighted-token meters, a dollar usage ceiling, and an optional pay-as-you-go wallet.

The monthly meters reset at the end of the billing period. The weekly caps roll (seven days, no reset instant), so a None reset there is the vendor’s answer, not missing data.

Fields§

§plan: String

plan.name, or “Pay as you go” when the organization has no plan.

§plan_price_cents: Option<i64>§plan_interval: Option<String>

"month", "3 months", … — already pluralized from interval_count.

§subscribed: bool§cancel_at_period_end: bool§monthly_input: Option<DeepRelayMeter>§monthly_output: Option<DeepRelayMeter>§weekly_input: Option<DeepRelayMeter>§weekly_output: Option<DeepRelayMeter>§backstop_used_usd: Option<f64>

Plan spend against the per-period usage ceiling, in dollars.

§backstop_limit_usd: Option<f64>§searches: Option<(u64, u64)>

(used, included) web searches this period.

§payg_calls_24h: Option<u64>

Calls billed to the wallet in the last 24 h while subscribed.

§balance_usd: Option<f64>

Wallet balance in dollars. Absent unless the balance request was made and answered.

§period_start: Option<DateTime<Utc>>§period_end: Option<DateTime<Utc>>§models: Vec<DeepRelayModelUsage>

Implementations§

Source§

impl DeepRelaySnapshot

Source

pub fn monthly_worst(&self) -> Option<&DeepRelayMeter>

The monthly meter closest to its ceiling — the one that will cap the account. Drives the bar headline, its severity class and the TUI overview cell.

Source

pub fn weekly_worst(&self) -> Option<&DeepRelayMeter>

The rolling-weekly meter closest to its ceiling.

Source

pub fn monthly_window(&self) -> Option<UsageWindow>

Monthly allowance as the shared window shape, for --format pacing.

Both period ends come from the server, so the length is exact rather than a guessed “30 days” — but the report still exposes no window_secs for these rows (they go through push_metric), because a frontend reads that field as a rolling window. Pacing here is local to a placeholder.

Source

pub fn weekly_window(&self) -> Option<UsageWindow>

Rolling weekly caps as the shared window shape. The window rolls, so it carries no reset instant; pacing stays neutral rather than guessing.

Trait Implementations§

Source§

impl Clone for DeepRelaySnapshot

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeepRelaySnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DeepRelaySnapshot

Source§

impl PartialEq for DeepRelaySnapshot

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DeepRelaySnapshot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more