rustronomy_core/meta/
auto.rs1use std::fmt::{Display, Debug, Formatter, Result};
23use super::MetaTag;
24
25#[derive(Debug, Clone, PartialEq)]
26pub struct Author(pub String);
28impl MetaTag for Author {}
29impl Display for Author {
30 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
31 write!(f, "[Author]: \"{}\"", self.0)
32 }
33}
34
35#[derive(Debug, Clone, PartialEq)]
36pub struct CreationDate(pub chrono::DateTime<chrono::Utc>);
38impl MetaTag for CreationDate {}
39impl Display for CreationDate {
40 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
41 write!(f, "[Creation date]: \"{}\"", self.0)
42 }
43}
44
45#[derive(Debug, Clone, PartialEq)]
46pub struct LastModified(pub chrono::DateTime<chrono::Utc>);
48impl MetaTag for LastModified {}
49impl Display for LastModified {
50 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
51 write!(f, "[Last modified date]: \"{}\"", self.0)
52 }
53}
54
55#[derive(Debug, Clone, PartialEq)]
56pub struct Organisation(pub String);
58impl MetaTag for Organisation {}
59impl Display for Organisation {
60 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
61 write!(f, "[Organisation]: \"{}\"", self.0)
62 }
63}
64
65#[derive(Debug, Clone, PartialEq)]
66pub struct Telescope(pub String);
68impl MetaTag for Telescope {}
69impl Display for Telescope {
70 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
71 write!(f, "[Telescope]: \"{}\"", self.0)
72 }
73}
74
75#[derive(Debug, Clone, PartialEq)]
76pub struct Instrument(pub String);
78impl MetaTag for Instrument {}
79impl Display for Instrument {
80 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
81 write!(f, "[Instrument]: \"{}\"", self.0)
82 }
83}
84
85#[derive(Debug, Clone, PartialEq)]
86pub struct Object(pub String);
88impl MetaTag for Object {}
89impl Display for Object {
90 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
91 write!(f, "[Target object]: \"{}\"", self.0)
92 }
93}
94
95#[derive(Debug, Clone, PartialEq)]
96pub struct ExposureTime(pub u64);
98impl MetaTag for ExposureTime {}
99impl Display for ExposureTime {
100 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
101 write!(f, "[Exposure time (ms)]: \"{}\"", self.0)
102 }
103}