pub struct NewsAPIClient { /* private fields */ }Expand description
NewsAPI client for market sentiment
Implementations§
Source§impl NewsAPIClient
impl NewsAPIClient
Sourcepub fn new(config: NewsAPIConfig) -> Self
pub fn new(config: NewsAPIConfig) -> Self
Create a new NewsAPI client
Sourcepub async fn search(
&self,
query: &str,
from: Option<DateTime<Utc>>,
to: Option<DateTime<Utc>>,
language: Option<&str>,
sort_by: Option<&str>,
) -> Result<Vec<NewsArticle>, NewsAPIError>
pub async fn search( &self, query: &str, from: Option<DateTime<Utc>>, to: Option<DateTime<Utc>>, language: Option<&str>, sort_by: Option<&str>, ) -> Result<Vec<NewsArticle>, NewsAPIError>
Search for news articles
Sourcepub async fn top_headlines(
&self,
country: Option<&str>,
category: Option<&str>,
sources: Option<Vec<String>>,
) -> Result<Vec<NewsArticle>, NewsAPIError>
pub async fn top_headlines( &self, country: Option<&str>, category: Option<&str>, sources: Option<Vec<String>>, ) -> Result<Vec<NewsArticle>, NewsAPIError>
Get top headlines
Auto Trait Implementations§
impl !Freeze for NewsAPIClient
impl !RefUnwindSafe for NewsAPIClient
impl Send for NewsAPIClient
impl Sync for NewsAPIClient
impl Unpin for NewsAPIClient
impl !UnwindSafe for NewsAPIClient
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