Struct pusher::PusherBuilder
source · [−]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>,
}
Expand description
An ephemeral object upon which to pass configuration options to when initializing a Pusher instance.
Fields
app_id: String
key: String
secret: String
host: String
secure: bool
http_client: Client<C>
Implementations
sourceimpl PusherBuilder<HttpConnector>
impl PusherBuilder<HttpConnector>
sourcepub fn new(app_id: &str, key: &str, secret: &str) -> PusherBuilder<HttpConnector>
pub fn new(app_id: &str, key: &str, secret: &str) -> PusherBuilder<HttpConnector>
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();
sourcepub fn from_url(url: &str) -> PusherBuilder<HttpConnector>
pub fn from_url(url: &str) -> PusherBuilder<HttpConnector>
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();
sourcepub fn from_env(key: &str) -> PusherBuilder<HttpConnector>
pub fn from_env(key: &str) -> PusherBuilder<HttpConnector>
Initializes a client from an environment variable Pusher URL.
This returns a PusherBuilder
, on which to set configuration options
before calling finalize()
.
Example:
Pusher::from_env("PUSHER_URL").finalize();
sourceimpl<C> PusherBuilder<C>
impl<C> PusherBuilder<C>
sourcepub fn new_with_client(
http_client: Client<C>,
app_id: &str,
key: &str,
secret: &str
) -> PusherBuilder<C>
pub fn new_with_client(
http_client: Client<C>,
app_id: &str,
key: &str,
secret: &str
) -> PusherBuilder<C>
Initializes the client with a specified hyper::client::connect::Connect. See pusher::PusherBuilder::new for more detail.
sourcepub fn from_url_with_client(
http_client: Client<C>,
url: &str
) -> PusherBuilder<C>
pub fn from_url_with_client(
http_client: Client<C>,
url: &str
) -> PusherBuilder<C>
Initializes the client with a specified hyper::client::connect::Connect. See pusher::PusherBuilder::from_url for more detail.
sourcepub fn from_env_with_client(
http_client: Client<C>,
key: &str
) -> PusherBuilder<C>
pub fn from_env_with_client(
http_client: Client<C>,
key: &str
) -> PusherBuilder<C>
Initializes the client with a specified hyper::client::connect::Connect. See pusher::PusherBuilder::from_env for more detail.
sourcepub fn host(self, host: &str) -> PusherBuilder<C>
pub fn host(self, host: &str) -> PusherBuilder<C>
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();
sourcepub fn secure(self) -> PusherBuilder<C>
pub fn secure(self) -> PusherBuilder<C>
This method determines whether requests will be made over HTTPS. This defaults to false
.
let pusher = PusherBuilder::new("id", "key", "secret").secure().finalize();
sourcepub fn client(self, http_client: Client<C>) -> PusherBuilder<C>
pub fn client(self, http_client: Client<C>) -> PusherBuilder<C>
If you wish to configure a Hyper client, pass it in to this method.
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
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more