#[non_exhaustive]pub struct Article {Show 17 fields
pub id: String,
pub link: String,
pub source: ArticleSource,
pub title: String,
pub summary: Option<String>,
pub language: Option<String>,
pub media: Vec<Media>,
pub published_at: Option<String>,
pub first_seen_at: Option<String>,
pub revised_at: Option<String>,
pub available_at: Option<String>,
pub countries: Vec<String>,
pub categories: Vec<String>,
pub content: Field<String>,
pub sentiment: Field<Sentiment>,
pub companies: Option<Vec<Company>>,
pub events: Option<Vec<EventTag>>,
/* private fields */
}Expand description
A news article (REST, streams and webhooks share this shape).
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.id: StringStable id (22 characters, base64url).
link: StringArticle URL.
source: ArticleSourceWhere the article comes from.
title: StringTitle in the original language.
summary: Option<String>Summary; None when there is none (never an empty string from the server).
language: Option<String>ISO 639-1 language.
media: Vec<Media>Images, at most 3.
published_at: Option<String>Publication time claimed by the source, as sent (legacy data can carry 1970-01-01).
first_seen_at: Option<String>Ingest time, as sent.
revised_at: Option<String>The source’s revision time, as sent.
available_at: Option<String>When the enriched article first became available, as sent (always None on raw).
countries: Vec<String>Geographic focus of the story (ISO alpha-2).
categories: Vec<String>Categories (open vocabulary).
content: Field<String>Full text: absent unless requested with include and entitled; null when there is none.
sentiment: Field<Sentiment>Sentiment: absent unless entitled; null when not computed.
companies: Option<Vec<Company>>Tagged companies: None when absent (not requested or not entitled); Some([]) means
tagged, no company.
events: Option<Vec<EventTag>>Tagged events: None when absent; Some([]) means classified, no event.
Implementations§
Source§impl Article
impl Article
Sourcepub fn content_present(&self) -> bool
pub fn content_present(&self) -> bool
true when the content key was in the JSON (null included).
Sourcepub fn sentiment_present(&self) -> bool
pub fn sentiment_present(&self) -> bool
true when the sentiment key was in the JSON (null included).
Sourcepub fn companies_present(&self) -> bool
pub fn companies_present(&self) -> bool
true when the companies key was in the JSON.
Sourcepub fn events_present(&self) -> bool
pub fn events_present(&self) -> bool
true when the events key was in the JSON.
Sourcepub fn published_at_time(&self) -> Option<SystemTime>
pub fn published_at_time(&self) -> Option<SystemTime>
published_at parsed strictly; None when absent or not RFC 3339.
Sourcepub fn first_seen_at_time(&self) -> Option<SystemTime>
pub fn first_seen_at_time(&self) -> Option<SystemTime>
first_seen_at parsed strictly.
Sourcepub fn revised_at_time(&self) -> Option<SystemTime>
pub fn revised_at_time(&self) -> Option<SystemTime>
revised_at parsed strictly.
Sourcepub fn available_at_time(&self) -> Option<SystemTime>
pub fn available_at_time(&self) -> Option<SystemTime>
available_at parsed strictly.