pub struct Statistic {
pub link: IdOrVanity,
pub stat_type: StatisticType,
pub data: StatisticData,
pub time: StatisticTime,
}Expand description
Fields§
§link: IdOrVanityThe ID or vanity path of the link that this statistic is about
stat_type: StatisticTypeThe type of this statistic
data: StatisticDataThe data for this statistic
time: StatisticTimeThe approximate time this statistic was collected at
Implementations§
Source§impl Statistic
impl Statistic
Sourcepub fn new(
link: impl Into<IdOrVanity>,
stat_type: StatisticType,
data: impl Into<StatisticData>,
) -> Self
pub fn new( link: impl Into<IdOrVanity>, stat_type: StatisticType, data: impl Into<StatisticData>, ) -> Self
Create a new Statistic from the provided information and the current
time
Sourcepub fn get_misc(
link: Option<&IdOrVanity>,
stat_info: ExtraStatisticInfo,
status_code: StatusCode,
categories: StatisticCategories,
) -> impl Iterator<Item = Statistic>
pub fn get_misc( link: Option<&IdOrVanity>, stat_info: ExtraStatisticInfo, status_code: StatusCode, categories: StatisticCategories, ) -> impl Iterator<Item = Statistic>
Get all statistics from the provided ExtraStatisticInfo and other
miscellaneous data. Only statistics specified by categories are
returned.
The returned value is an iterator over statistics with some or all of the following types:
Sourcepub fn from_req<T>(
link: Option<&IdOrVanity>,
req: &Request<T>,
categories: StatisticCategories,
) -> impl Iterator<Item = Statistic>
pub fn from_req<T>( link: Option<&IdOrVanity>, req: &Request<T>, categories: StatisticCategories, ) -> impl Iterator<Item = Statistic>
Get all possible statistics from the provided HTTP request info. Only
statistics specified by categories are returned.
The returned value is an iterator over statistics with some or all of the following types:
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Statistic
impl<'de> Deserialize<'de> for Statistic
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 Statistic
impl StructuralPartialEq for Statistic
Auto Trait Implementations§
impl Freeze for Statistic
impl RefUnwindSafe for Statistic
impl Send for Statistic
impl Sync for Statistic
impl Unpin for Statistic
impl UnwindSafe for Statistic
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,
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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§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> 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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request