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: u64Duration since the last refill operation in seconds
refill_volume_last_24h: f64Total volume of refills in the last 24 hours in liters
refill_count_last_24h: u64Count of refills in the last 24 hours
refill_volume_last_hour: f64Total volume of refills in the last hour in liters
refill_count_last_hour: u64Count of refills in the last hour
Implementations§
Source§impl RefillStatsData
impl RefillStatsData
Sourcepub fn new() -> RefillStatsData
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
impl Display for RefillStatsData
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
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 thefmt::Displaytrait.
§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.