Struct RefillStatsData

Source
pub struct RefillStatsData {
    pub duration_since_last_refill: u64,
    pub refill_volume_last_24h: f64,
    pub refill_count_last_24h: u64,
    pub refill_volume_last_hour: f64,
    pub refill_count_last_hour: u64,
}
Expand description

Contains the data retrieved from the SQL database. It is also used to communicate data to be updated in the SQL database.

Fields§

§duration_since_last_refill: u64

Duration since the last refill operation in seconds

§refill_volume_last_24h: f64

Total volume of refills in the last 24 hours in liters

§refill_count_last_24h: u64

Count of refills in the last 24 hours

§refill_volume_last_hour: f64

Total volume of refills in the last hour in liters

§refill_count_last_hour: u64

Count of refills in the last hour

Implementations§

Source§

impl RefillStatsData

Source

pub fn new() -> RefillStatsData

Creates a new RefillStatsData instance, with all its fields initialized to zero.

This constructor provides a default, empty state for storing historical refill data, suitable for initialization before actual values are retrieved from the database.

§Returns

A new RefillStatsData struct with all numeric fields set to 0 or 0.0.

Trait Implementations§

Source§

impl Display for RefillStatsData

Source§

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

Provides a multi-line, human-readable output of the struct’s values for debugging purposes.

This implementation formats all fields of the RefillStatsData struct into a detailed string representation, summarizing historical refill statistics such as duration since the last refill, and total volume and count for both the last 24 hours and the last hour. This is particularly useful for inspecting refill data during development and logging.

§Arguments
  • f - A mutable reference to the formatter, as required by the fmt::Display trait.
§Returns

An Ok(()) on successful formatting.

§Errors

Returns an Err containing a std::fmt::Error if an I/O error occurs while writing to the formatter.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T