[][src]Struct libvplan::client::Client

pub struct Client { /* fields omitted */ }

A client to retrieve a vplan.

Example

This example is not tested
extern crate chrono;
extern crate futures;
extern crate libvplan;
extern crate tokio;

use chrono::Weekday;
use libvplan::Client;
use tokio::runtime::Runtime;

let client = Client::new("username", "password");

let future = client.get_vplan(Weekday::Mon);

let mut rt = match Runtime::new() {
    Ok(rt) => rt,
    Err(error) => panic!(error)
};

let result = rt.block_on(future);

println!("{:#?}", result);

Methods

impl Client[src]

pub fn new(url: &str) -> Self[src]

Creates a new client for the given url.

pub fn with_auth(url: &str, authorization: &str) -> Self[src]

Creates a new client via a preformatted HTTP Basic authentication string (base64 "username:password").

pub fn with_credentials(url: &str, username: &str, password: &str) -> Self[src]

Creates a new client with username and password for HTTP Basic authentication.

pub fn get(&self, day: Weekday) -> ResponseFuture[src]

Retrieves the timetable change for the given day

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.