25 lines
545 B
Rust
25 lines
545 B
Rust
|
|
use std::fmt::{Display, Formatter};
|
||
|
|
use crate::models::fueltank::Pump;
|
||
|
|
|
||
|
|
#[derive(Clone, Serialize, Deserialize, Debug)]
|
||
|
|
pub struct NasaAstroPhoto {
|
||
|
|
pub explanation: String,
|
||
|
|
pub hdurl: String,
|
||
|
|
pub title: String
|
||
|
|
}
|
||
|
|
|
||
|
|
impl Display for NasaAstroPhoto {
|
||
|
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||
|
|
write!(f, "{}", self.hdurl)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
impl Pump<NasaAstroPhoto> for NasaAstroPhoto {
|
||
|
|
fn pump(&mut self) -> Option<NasaAstroPhoto> {
|
||
|
|
Some(self.clone())
|
||
|
|
}
|
||
|
|
|
||
|
|
fn len(&self) -> usize {
|
||
|
|
1
|
||
|
|
}
|
||
|
|
}
|