Skip to main content

SenderPool

Struct SenderPool 

Source
pub struct SenderPool {
    pub runner: SenderPoolRunner,
    pub handle: SenderPoolFatHandle,
    pub updates: UnboundedReceiver<UpdatesLike>,
}
Expand description

Builder to configure the runner to drive I/O and linked handles.

Fields§

§runner: SenderPoolRunner

The single mutable instance responsible for driving I/O.

Connections are created on-demand, so any errors while the pool is running can only be retrieved with one of the SenderPool::handles.

§handle: SenderPoolFatHandle

Starting fat handle attached to the SenderPool::runner.

Handles are the only way to interact with the runner once it’s running.

§updates: UnboundedReceiver<UpdatesLike>

The single mutable channel through which updates received from the network by the SenderPool::runner are delivered.

Update handling must be processed in a sequential manner, so this is a separate instance with no way to clone it.

Implementations§

Source§

impl SenderPool

Source

pub fn new<S>(session: Arc<S>, api_id: i32) -> SenderPool
where S: Session + 'static,

Creates a new sender pool instance with default configuration, attached to the given session and using the provided Application Identifier belonging to the developer.

Session instance should not be reused by multiple pools at the same time. The session instance will only be used to query datacenter options and persist any permanent Authorization Keys generated for previously-unconncected datacenters.

Source

pub fn with_configuration<S>( session: Arc<S>, api_id: i32, connection_params: ConnectionParams, ) -> SenderPool
where S: Session + 'static,

Creates a new sender pool with non-ConnectionParams::default configuration.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.