[−][src]Struct lobsters::client::Client
The main Lobsters client
Methods
impl Client
[src]
pub fn new(base_url: Url) -> Result<Self, Error>
[src]
Create a new client
Will attempt to load the cookie store if it exists.
pub fn login(
&self,
username_or_email: String,
password: String
) -> impl Future<Item = (), Error = Error>
[src]
&self,
username_or_email: String,
password: String
) -> impl Future<Item = (), Error = Error>
Attempt to authenticate with the server
pub fn index(
&self,
page: Option<Page>
) -> impl Future<Item = Vec<Story>, Error = Error>
[src]
&self,
page: Option<Page>
) -> impl Future<Item = Vec<Story>, Error = Error>
Retrieve the front page stories, newest first
pub fn story(
&self,
story_id: &StoryId
) -> impl Future<Item = Story, Error = Error>
[src]
&self,
story_id: &StoryId
) -> impl Future<Item = Story, Error = Error>
Retrieve the comments for a story
pub fn tags(&self) -> impl Future<Item = Vec<Tag>, Error = Error>
[src]
Retrieve the list of tags on the site
pub fn post_comment(
&self,
comment: NewComment
) -> impl Future<Item = Option<String>, Error = Error>
[src]
&self,
comment: NewComment
) -> impl Future<Item = Option<String>, Error = Error>
Post a new comment on a story
pub fn save_cookies(&self) -> Result<(), Error>
[src]
Save the cookie store so that a client can be created without needing to log in first
pub fn base_url(&self) -> &Url
[src]
The base URL of the remote site the client will communicate with
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,