2020-05-23 14:19:04 +00:00
|
|
|
use std::fmt;
|
|
|
|
|
2020-05-11 19:21:57 +00:00
|
|
|
#[derive(PartialEq, Clone, Debug)]
|
2020-05-24 16:16:32 +00:00
|
|
|
/// Price result
|
2020-05-11 19:21:57 +00:00
|
|
|
pub struct PriceResult {
|
2020-05-24 16:16:32 +00:00
|
|
|
/// The name of object
|
2020-05-11 19:21:57 +00:00
|
|
|
pub name: String,
|
2020-05-24 16:16:32 +00:00
|
|
|
/// The product type
|
2020-05-11 19:21:57 +00:00
|
|
|
pub product: String,
|
2020-05-24 16:16:32 +00:00
|
|
|
/// The price
|
2020-07-20 20:14:05 +00:00
|
|
|
pub price: f64,
|
2020-05-23 14:19:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl fmt::Display for PriceResult {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
2020-07-20 20:14:05 +00:00
|
|
|
write!(f, "Product «{}: {}» price {}€", self.product, self.name, self.price)
|
|
|
|
}
|
|
|
|
}
|