#[non_exhaustive]pub struct Briefing {
pub source: String,
pub generated_at: Option<DateTime<Utc>>,
pub departure_at: Option<DateTime<Utc>>,
pub narrative: Option<String>,
pub products: Vec<Product>,
}Expand description
A completed weather briefing.
Sources differ in shape: product-oriented APIs fill Self::products,
document-oriented services (one rendered briefing text) fill
Self::narrative. Either may be empty, both may be present.
#[non_exhaustive]: construct with Briefing::new and the with_*
setters.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.source: Stringcrate::ContextProvider::name of the producing source.
generated_at: Option<DateTime<Utc>>When this briefing was assembled by the adapter (fetch time,
UTC). Provider-stated product times live on each Product.
departure_at: Option<DateTime<Utc>>The departure time this briefing answered for, when the request
was ETD-anchored — None means “conditions now”.
narrative: Option<String>Single-document briefing text, for document-oriented sources.
products: Vec<Product>Discrete products, for product-oriented sources.
Implementations§
Source§impl Briefing
impl Briefing
Sourcepub fn new(source: impl Into<String>) -> Self
pub fn new(source: impl Into<String>) -> Self
An empty briefing attributed to source; fill it with the with_*
setters.
Sourcepub fn with_generated_at(self, generated_at: Option<DateTime<Utc>>) -> Self
pub fn with_generated_at(self, generated_at: Option<DateTime<Utc>>) -> Self
Set the generation time.
Sourcepub fn with_departure_at(self, at: Option<DateTime<Utc>>) -> Self
pub fn with_departure_at(self, at: Option<DateTime<Utc>>) -> Self
Set the departure time this briefing answered for — only for sources that genuinely anchor their window to it.
Sourcepub fn with_narrative(self, narrative: Option<String>) -> Self
pub fn with_narrative(self, narrative: Option<String>) -> Self
Set the single-document narrative.
Sourcepub fn with_products(self, products: Vec<Product>) -> Self
pub fn with_products(self, products: Vec<Product>) -> Self
Set the discrete products.