Struct stack_overflow_client::client::StackClient
source · pub struct StackClient { /* private fields */ }
Implementations§
source§impl StackClient
impl StackClient
StackClient is a client for the Stack Exchange API
Construct a default client for StackOverflow site, API version 2.3 (https://meta.stackexchange.com/questions/366977/api-2-3-release)
use stack_overflow::client::StackClient;
let client = StackClient::new();
Construct a e client for a specific site and API version
use stack_overflow::client::StackClientBuilder;
use stack_overflow::common::{ApiVersion, StackSite};
let client = StackClientBuilder::new()
.stack_site(StackSite::StackOverflow)
.version(ApiVersion::V2_3)
.build();
sourcepub async fn get_info(&self) -> Result<Response<Info>, Box<dyn Error>>
pub async fn get_info(&self) -> Result<Response<Info>, Box<dyn Error>>
Get info about the client’s Stack site. Returns a collection of statistics about the site. API Docs: https://api.stackexchange.com/docs/info
sourcepub async fn get_featured_questions(
&self,
tag: &str
) -> Result<Response<Question>, Box<dyn Error>>
pub async fn get_featured_questions( &self, tag: &str ) -> Result<Response<Question>, Box<dyn Error>>
Get featured questions for a tag. Note that this only retrieves the first page of results. API Docs: https://api.stackexchange.com/docs/featured-questions
sourcepub async fn get_featured_questions_paginated(
&self,
tag: &str,
page: u32
) -> Result<Response<Question>, Box<dyn Error>>
pub async fn get_featured_questions_paginated( &self, tag: &str, page: u32 ) -> Result<Response<Question>, Box<dyn Error>>
Get featured questions for a tag and explicitly provide a page. Note that pagination is not supported beyond 25 pages because authentication is required. API Docs: https://api.stackexchange.com/docs/featured-questions
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StackClient
impl Send for StackClient
impl Sync for StackClient
impl Unpin for StackClient
impl !UnwindSafe for StackClient
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