pub struct Client { /* private fields */ }Expand description
Manages access to the Something Awful forums.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new() -> Result<Client, Error>
pub fn new() -> Result<Client, Error>
Constructs an unauthenticated client. The user must either login or load credentials before using other API functions.
Sourcepub async fn login(&self, username: &str, password: &str) -> Result<(), Error>
pub async fn login(&self, username: &str, password: &str) -> Result<(), Error>
Attempts to login. Returns ReqwestError on a communication error or LoginError if the login request failed.
Sourcepub async fn fetch_profile<'a>(
&self,
user: User<'a>,
) -> Result<Option<Profile>, Error>
pub async fn fetch_profile<'a>( &self, user: User<'a>, ) -> Result<Option<Profile>, Error>
Returns the profile of a user, or None if that user cannot be found.
Sourcepub async fn fetch_posts(
&self,
thread_id: &str,
index: ThreadPage,
) -> Result<Vec<Post>, Error>
pub async fn fetch_posts( &self, thread_id: &str, index: ThreadPage, ) -> Result<Vec<Post>, Error>
Returns all posts on a given page of a thread.
Sourcepub async fn fetch_bookmarked_threads(&self) -> Result<Vec<Thread>, Error>
pub async fn fetch_bookmarked_threads(&self) -> Result<Vec<Thread>, Error>
Returns metadata about all bookmarked threads.
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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