#[non_exhaustive]pub struct StreamParams {Show 13 fields
pub query: Option<String>,
pub sources: Option<Vec<String>>,
pub exclude_sources: Option<Vec<String>>,
pub opt_in_sources: Option<Vec<String>>,
pub language: Option<String>,
pub tickers: Option<Vec<String>>,
pub countries: Option<Vec<String>>,
pub categories: Option<Vec<String>>,
pub source_types: Option<Vec<SourceType>>,
pub exclude_source_types: Option<Vec<SourceType>>,
pub exclude_empty_content: Option<bool>,
pub include_updates: Option<bool>,
pub include: Option<Vec<IncludeBlock>>,
}Expand description
Subscribe parameters of the enriched stream (client.stream()).
Streams keep the subscription vocabulary: one language, no flat event or role filters
(use query, e.g. eventType:mna).
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.query: Option<String>Query (lenient stream grammar).
sources: Option<Vec<String>>Only these source domains.
exclude_sources: Option<Vec<String>>Source domains left out.
opt_in_sources: Option<Vec<String>>Non-default sources added.
language: Option<String>One language (ISO 639-1); the server default is en.
tickers: Option<Vec<String>>Tickers.
countries: Option<Vec<String>>Story countries.
categories: Option<Vec<String>>Categories.
source_types: Option<Vec<SourceType>>Only sources of these types. Articles of unclassified sources never match.
exclude_source_types: Option<Vec<SourceType>>Source types left out. Articles of unclassified sources are kept.
exclude_empty_content: Option<bool>Leave out articles without content.
include_updates: Option<bool>Without it the server never sends article.updated.
include: Option<Vec<IncludeBlock>>Extra blocks (at most 3).
Implementations§
Source§impl StreamParams
impl StreamParams
Sourcepub fn from_json(json: &str) -> Result<Self>
pub fn from_json(json: &str) -> Result<Self>
Reads parameters from a JSON object with the wire keys; unknown keys are rejected.
Sourcepub fn exclude_sources<I, S>(self, values: I) -> Self
pub fn exclude_sources<I, S>(self, values: I) -> Self
Source domains left out.
Sourcepub fn opt_in_sources<I, S>(self, values: I) -> Self
pub fn opt_in_sources<I, S>(self, values: I) -> Self
Non-default sources added.
Sourcepub fn categories<I, S>(self, values: I) -> Self
pub fn categories<I, S>(self, values: I) -> Self
Categories.
Sourcepub fn source_types<I, S>(self, values: I) -> Self
pub fn source_types<I, S>(self, values: I) -> Self
Only sources of these types (SourceType::NEWSWIRE, …).
Sourcepub fn exclude_source_types<I, S>(self, values: I) -> Self
pub fn exclude_source_types<I, S>(self, values: I) -> Self
Source types left out.
Sourcepub fn exclude_empty_content(self, value: bool) -> Self
pub fn exclude_empty_content(self, value: bool) -> Self
Leave out articles without content.
Sourcepub fn include_updates(self, value: bool) -> Self
pub fn include_updates(self, value: bool) -> Self
Also deliver article.updated.