pub struct UsageQuery {
pub since: Option<String>,
pub until: Option<String>,
pub days: Option<i64>,
}Expand description
Query params for GET /api/usage.
Both bounds are optional; the handler fills in a default window and echoes
back what it used. Like FromSeq, this is a URL-query extractor rather
than part of the body contract, so it stays in this crate.
Fields§
§since: Option<String>Inclusive window start (RFC-3339). Defaults to 7 days before until.
until: Option<String>Exclusive window end (RFC-3339). Defaults to now.
days: Option<i64>How many days back to look, as an alternative to since.
The dashboard’s window control sends this rather than a computed
timestamp so the server resolves the bound against its own clock; a
browser whose clock has drifted would otherwise silently clip or pad the
window. Ignored when since is given explicitly.
Trait Implementations§
Source§impl Debug for UsageQuery
impl Debug for UsageQuery
Source§impl Default for UsageQuery
impl Default for UsageQuery
Source§fn default() -> UsageQuery
fn default() -> UsageQuery
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UsageQuery
impl<'de> Deserialize<'de> for UsageQuery
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
Auto Trait Implementations§
impl Freeze for UsageQuery
impl RefUnwindSafe for UsageQuery
impl Send for UsageQuery
impl Sync for UsageQuery
impl Unpin for UsageQuery
impl UnsafeUnpin for UsageQuery
impl UnwindSafe for UsageQuery
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 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>
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