[−][src]Struct pubnub_core::Builder
PubNub Client Builder
Create a crate::PubNub
client using the builder pattern.
Optional items can be overridden using this.
Methods
impl<TTransport, TRuntime> Builder<TTransport, TRuntime> where
TTransport: Transport,
TRuntime: Runtime,
[src]
TTransport: Transport,
TRuntime: Runtime,
impl<TTransport, TRuntime> Builder<TTransport, TRuntime>
[src]
#[must_use]pub fn with_components(transport: TTransport, runtime: TRuntime) -> Self
[src]
Create a new Builder
that can configure a PubNub
client
with custom component implementations.
Example
use pubnub_core::mock::{runtime::MockRuntime, transport::MockTransport}; use pubnub_core::Builder; let transport = MockTransport::new(); let runtime = MockRuntime::new(); let pubnub = Builder::with_components(transport, runtime).build();
#[must_use]pub fn subscribe_loop_exit_tx(self, tx: Sender<()>) -> Self
[src]
Set the subscribe loop exit tx.
If set, subscribe loop sends a message to it when it exits.
Example
use pubnub_core::Builder; let (tx, _rx) = futures_channel::mpsc::channel(1); let pubnub = Builder::with_components(transport, runtime) .subscribe_loop_exit_tx(tx) .build();
#[must_use]pub fn transport<U: Transport>(self, transport: U) -> Builder<U, TRuntime>
[src]
Set the transport to use.
This allows changing the Transport
type on the builder and,
therefore, on the resulting PubNub
client.
#[must_use]pub fn runtime<U: Runtime>(self, runtime: U) -> Builder<TTransport, U>
[src]
impl Builder<(), ()>
[src]
#[must_use]pub fn new() -> Self
[src]
Create a new Builder
that can configure a PubNub
client.
Example
use pubnub_core::mock::{runtime::MockRuntime, transport::MockTransport}; use pubnub_core::Builder; let transport = MockTransport::new(); let runtime = MockRuntime::new(); let pubnub = Builder::new().transport(transport).runtime(runtime).build();
Trait Implementations
impl<TTransport: Clone, TRuntime: Clone> Clone for Builder<TTransport, TRuntime>
[src]
fn clone(&self) -> Builder<TTransport, TRuntime>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<TTransport: Debug, TRuntime: Debug> Debug for Builder<TTransport, TRuntime>
[src]
impl<TTransport, TRuntime> Default for Builder<TTransport, TRuntime> where
TTransport: Default,
TRuntime: Default,
[src]
TTransport: Default,
TRuntime: Default,
Auto Trait Implementations
impl<TTransport = (), TRuntime = ()> !RefUnwindSafe for Builder<TTransport, TRuntime>
impl<TTransport, TRuntime> Send for Builder<TTransport, TRuntime> where
TRuntime: Send,
TTransport: Send,
TRuntime: Send,
TTransport: Send,
impl<TTransport, TRuntime> Sync for Builder<TTransport, TRuntime> where
TRuntime: Sync,
TTransport: Sync,
TRuntime: Sync,
TTransport: Sync,
impl<TTransport, TRuntime> Unpin for Builder<TTransport, TRuntime> where
TRuntime: Unpin,
TTransport: Unpin,
TRuntime: Unpin,
TTransport: Unpin,
impl<TTransport = (), TRuntime = ()> !UnwindSafe for Builder<TTransport, TRuntime>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any + ?Sized,
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,