pub struct Client { /* private fields */ }
Implementations
sourceimpl Client
impl Client
sourcepub fn new(root_url: &str) -> Result<Client, Box<dyn Error>>
pub fn new(root_url: &str) -> Result<Client, Box<dyn Error>>
Constructs a new Client
.
This client contains the web session.
sourcepub fn forums(&mut self) -> Result<Vec<String>, Box<dyn Error>>
pub fn forums(&mut self) -> Result<Vec<String>, Box<dyn Error>>
Get the names of all the forums.
sourcepub fn submissions_from_page(
&mut self,
url: &str
) -> Result<Vec<SubmissionInfo>, Box<dyn Error>>
pub fn submissions_from_page(
&mut self,
url: &str
) -> Result<Vec<SubmissionInfo>, Box<dyn Error>>
Get a list of all the urls of submissions on a page.
sourcepub fn submissions_from_page_until(
&mut self,
url: &str,
date: DateTime<FixedOffset>
) -> Result<Vec<SubmissionInfo>, Box<dyn Error>>
pub fn submissions_from_page_until(
&mut self,
url: &str,
date: DateTime<FixedOffset>
) -> Result<Vec<SubmissionInfo>, Box<dyn Error>>
Get a list of all the urls of submissions on a page from now until a certain date.
sourcepub fn submission_urls_from_page(
&mut self,
url: &str
) -> Result<Vec<String>, Box<dyn Error>>
pub fn submission_urls_from_page(
&mut self,
url: &str
) -> Result<Vec<String>, Box<dyn Error>>
Get a list of all the urls of submissions on a page.
sourcepub fn comments_until(
&mut self,
date: DateTime<FixedOffset>
) -> Result<Vec<CommentInfo>, Box<dyn Error>>
pub fn comments_until(
&mut self,
date: DateTime<FixedOffset>
) -> Result<Vec<CommentInfo>, Box<dyn Error>>
Get a list of all the comments until a certain date.
sourcepub fn login(
&mut self,
username: &str,
password: &str
) -> Result<(), Box<dyn Error>>
pub fn login(
&mut self,
username: &str,
password: &str
) -> Result<(), Box<dyn Error>>
Login as a user. This sets the session cookie and the csrf token which are bound to the user login.
sourcepub fn reply_comment(
&mut self,
submission_id: u64,
comment_id: u64,
comment: &str
) -> Result<u64, Box<dyn Error>>
pub fn reply_comment(
&mut self,
submission_id: u64,
comment_id: u64,
comment: &str
) -> Result<u64, Box<dyn Error>>
Reply on a comment.
sourcepub fn comment_post(
&mut self,
submission_id: u64,
comment: &str
) -> Result<u64, Box<dyn Error>>
pub fn comment_post(
&mut self,
submission_id: u64,
comment: &str
) -> Result<u64, Box<dyn Error>>
Comment on a forum post.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more