pub struct NewsParams {
pub symbols: Option<String>,
pub start: Option<String>,
pub end: Option<String>,
pub sort: Option<String>,
pub include_content: Option<bool>,
pub exclude_contentless: Option<bool>,
pub limit: Option<u32>,
pub page_token: Option<String>,
}Expand description
Parameters for news request.
Fields§
§symbols: Option<String>Filter by symbols (comma-separated).
start: Option<String>Start time (RFC3339).
end: Option<String>End time (RFC3339).
sort: Option<String>Sort order (asc or desc).
include_content: Option<bool>Include content in response.
exclude_contentless: Option<bool>Exclude articles without content.
limit: Option<u32>Maximum number of articles.
page_token: Option<String>Page token for pagination.
Implementations§
Source§impl NewsParams
impl NewsParams
Sourcepub fn new() -> NewsParams
pub fn new() -> NewsParams
Create new empty parameters.
Sourcepub fn symbols(self, symbols: &str) -> NewsParams
pub fn symbols(self, symbols: &str) -> NewsParams
Filter by symbols.
Sourcepub fn time_range(self, start: &str, end: &str) -> NewsParams
pub fn time_range(self, start: &str, end: &str) -> NewsParams
Set time range.
Sourcepub fn sort_desc(self) -> NewsParams
pub fn sort_desc(self) -> NewsParams
Sort descending (newest first).
Sourcepub fn sort_asc(self) -> NewsParams
pub fn sort_asc(self) -> NewsParams
Sort ascending (oldest first).
Sourcepub fn with_content(self) -> NewsParams
pub fn with_content(self) -> NewsParams
Include full content.
Sourcepub fn exclude_empty(self) -> NewsParams
pub fn exclude_empty(self) -> NewsParams
Exclude articles without content.
Sourcepub fn limit(self, limit: u32) -> NewsParams
pub fn limit(self, limit: u32) -> NewsParams
Set limit.
Sourcepub fn page_token(self, token: &str) -> NewsParams
pub fn page_token(self, token: &str) -> NewsParams
Set page token.
Trait Implementations§
Source§impl Clone for NewsParams
impl Clone for NewsParams
Source§fn clone(&self) -> NewsParams
fn clone(&self) -> NewsParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NewsParams
impl Debug for NewsParams
Source§impl Default for NewsParams
impl Default for NewsParams
Source§fn default() -> NewsParams
fn default() -> NewsParams
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for NewsParams
impl<'de> Deserialize<'de> for NewsParams
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NewsParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NewsParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for NewsParams
impl Serialize for NewsParams
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for NewsParams
impl RefUnwindSafe for NewsParams
impl Send for NewsParams
impl Sync for NewsParams
impl Unpin for NewsParams
impl UnwindSafe for NewsParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more