[][src]Struct pusher::PusherBuilder

pub struct PusherBuilder<C> {
    pub app_id: String,
    pub key: String,
    pub secret: String,
    pub host: String,
    pub secure: bool,
    pub http_client: Client<C>,
}

An ephemeral object upon which to pass configuration options to when initializing a Pusher instance.

Fields

app_id: Stringkey: Stringsecret: Stringhost: Stringsecure: boolhttp_client: Client<C>

Implementations

impl PusherBuilder<HttpConnector>[src]

pub fn new(
    app_id: &str,
    key: &str,
    secret: &str
) -> PusherBuilder<HttpConnector>
[src]

Initializes the client that makes requests to the HTTP API, authenticates private- or presence-channels, and validates webhooks.

This returns a PusherBuilder, on which to set configuration options before calling finalize().

Example:

let pusher = PusherBuilder::new("id", "key", "secret").host("foo.bar.com").finalize();

pub fn from_url(url: &str) -> PusherBuilder<HttpConnector>[src]

Initializes a client from a Pusher URL.

This returns a PusherBuilder, on which to set configuration options before calling finalize().

Example:

PusherBuilder::from_url("http://key:secret@api.host.com/apps/id").finalize();

pub fn from_env(key: &str) -> PusherBuilder<HttpConnector>[src]

Initializes a client from an environment variable Pusher URL.

This returns a PusherBuilder, on which to set configuration options before calling finalize().

Example:

This example is not tested
Pusher::from_env("PUSHER_URL").finalize();

impl<C> PusherBuilder<C>[src]

pub fn new_with_client(
    http_client: Client<C>,
    app_id: &str,
    key: &str,
    secret: &str
) -> PusherBuilder<C>
[src]

Initializes the client with a specified hyper::client::connect::Connect. See pusher::PusherBuilder::new for more detail.

pub fn from_url_with_client(
    http_client: Client<C>,
    url: &str
) -> PusherBuilder<C>
[src]

Initializes the client with a specified hyper::client::connect::Connect. See pusher::PusherBuilder::from_url for more detail.

pub fn from_env_with_client(
    http_client: Client<C>,
    key: &str
) -> PusherBuilder<C>
[src]

Initializes the client with a specified hyper::client::connect::Connect. See pusher::PusherBuilder::from_env for more detail.

pub fn host(self, host: &str) -> PusherBuilder<C>[src]

This method changes the host to which API requests will be made. This defaults to api.pusherapp.com.

let pusher = PusherBuilder::new("id", "key", "secret").host("foo.bar.com").finalize();

pub fn secure(self) -> PusherBuilder<C>[src]

This method determines whether requests will be made over HTTPS. This defaults to false.

let pusher = PusherBuilder::new("id", "key", "secret").secure().finalize();

pub fn client(self, http_client: Client<C>) -> PusherBuilder<C>[src]

If you wish to configure a Hyper client, pass it in to this method.

pub fn finalize(self) -> Pusher<C>[src]

This method actually creates the Pusher instance from your chained configuration.

Auto Trait Implementations

impl<C> !RefUnwindSafe for PusherBuilder<C>

impl<C> Send for PusherBuilder<C> where
    C: Send

impl<C> Sync for PusherBuilder<C> where
    C: Sync

impl<C> Unpin for PusherBuilder<C> where
    C: Unpin

impl<C> !UnwindSafe for PusherBuilder<C>

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.