manifold/src/models/nasa.rs

25 lines
545 B
Rust
Raw Normal View History

2023-08-30 17:44:39 +00:00
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
}
}