[][src]Struct lobsters::client::Client

pub struct Client { /* fields omitted */ }

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]

Attempt to authenticate with the server

pub fn index(
    &self,
    page: Option<Page>
) -> impl Future<Item = Vec<Story>, Error = Error>
[src]

Retrieve the front page stories, newest first

pub fn story(
    &self,
    story_id: &StoryId
) -> impl Future<Item = Story, Error = Error>
[src]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err