Struct GetNewsSourcesParams

Source
pub struct GetNewsSourcesParams {
    pub id: Option<Vec<String>>,
    pub country: Option<Vec<String>>,
    pub category: Option<Vec<String>>,
    pub exclude_category: Option<Vec<String>>,
    pub language: Option<String>,
    pub priority_domain: Option<String>,
}
Expand description

Parameters for the get_news_sources method.

Fields§

§id: Option<Vec<String>>

Unique identifier of the news source.
Max no. of id could be added: 50

§country: Option<Vec<String>>

Country code for the news sources.
Max no. of country could be added: 5.
Examples: “hk”, “us”, “wo”

§category: Option<Vec<String>>

Category for the news sources.
Max no. of category could be added: 5.
Possible values: “business”, “crime”, “domestic”, “education”, “entertainment”, “environment”, “food”, “health”, “lifestyle”, “other”, “politics”, “science”, “sports”, “technology”, “top”, “tourism”, “world”

§exclude_category: Option<Vec<String>>

Exclude category for the news sources.
Max no. of category could be added: 5.
Exclusive with category.
Possible values: “business”, “crime”, “domestic”, “education”, “entertainment”, “environment”, “food”, “health”, “lifestyle”, “other”, “politics”, “science”, “sports”, “technology”, “top”, “tourism”, “world”

§language: Option<String>

Language code for the news sources.
Max no. of language could be added: 5.

§priority_domain: Option<String>

Priority domain for the news articles.
Top: Fetches news articles from the top 10% of the news domains
Medium: Fetches news articles from the top 30% of the news domains. It means it already includes all the news articles of “top” priority.
Low: Fetches news articles from the top 50% of the news domains. It means it already includes all the news articles of “top” and “medium” priorities.

Implementations§

Source§

impl GetNewsSourcesParams

Source

pub fn default() -> Self

Creates a new GetNewsSourcesParams with default values.

This method sets the default values for all parameters, which are:

  • id: None
  • country: None
  • category: None
  • exclude_category: None
  • language: None
  • priority_domain: None

This allows you to easily create a GetNewsSourcesParams object without having to specify all the parameters manually.

Trait Implementations§

Source§

impl Debug for GetNewsSourcesParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GetNewsSourcesParams

Source§

fn default() -> GetNewsSourcesParams

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,