pub struct Pool<D: Direction<B>, F: Profile, B: PoolDriver> { /* private fields */ }Implementations§
Source§impl<P, T, S, F, B> Pool<Client<P, T, S>, F, B>where
P: ClientProtocol,
T: Transport,
T::Addr: Clone,
S: ConnectSource<T>,
F: Profile,
B: PoolDriver,
impl<P, T, S, F, B> Pool<Client<P, T, S>, F, B>where
P: ClientProtocol,
T: Transport,
T::Addr: Clone,
S: ConnectSource<T>,
F: Profile,
B: PoolDriver,
pub fn poke_outbound( &mut self, driver: &mut B::Driver, conn_id: SlotId, ) -> Result<(), PushError>
pub fn pump_outbound(&mut self, driver: &mut B::Driver) -> usize
Source§impl<P, T, S, F, B> Pool<Client<P, T, S>, F, B>where
P: ClientProtocol,
T: Transport,
T::Addr: Clone,
S: ConnectSource<T>,
F: Profile,
B: PoolDriver,
impl<P, T, S, F, B> Pool<Client<P, T, S>, F, B>where
P: ClientProtocol,
T: Transport,
T::Addr: Clone,
S: ConnectSource<T>,
F: Profile,
B: PoolDriver,
pub fn new( direction: Client<P, T, S>, max_conn: usize, slot_id_base: usize, ) -> Result<Self>
pub fn slot_id_range(&self) -> Range<usize>
pub fn conn_slot_count(&self) -> usize
pub fn direction_mut(&mut self) -> &mut Client<P, T, S>
pub fn live_conns(&self) -> impl Iterator<Item = SlotId> + '_
pub fn is_live(&self, conn_id: SlotId) -> bool
pub fn session_mut(&mut self, conn_id: SlotId) -> Option<&mut ClientSession<P>>
Sourcepub fn session_with_codec_mut(
&mut self,
conn_id: SlotId,
) -> Option<(&mut ClientSession<P>, &mut <P::CodecLayer as CodecLayer>::ConnState)>
pub fn session_with_codec_mut( &mut self, conn_id: SlotId, ) -> Option<(&mut ClientSession<P>, &mut <P::CodecLayer as CodecLayer>::ConnState)>
Out-of-callback access to both the session and the paired codec state.
Note: mutations made through this accessor do not auto-poke the
outbound path. After mutating codec state in a way that should produce
wire bytes (e.g. triggering a TLS handshake), call
Pool::poke_outbound to wake the slot.
Source§impl<H: ServerProtocol, T: Transport, F: Profile, B: PoolDriver> Pool<Server<H, T>, F, B>
impl<H: ServerProtocol, T: Transport, F: Profile, B: PoolDriver> Pool<Server<H, T>, F, B>
Source§impl<H, T, F, B> Pool<Server<H, T>, F, B>
impl<H, T, F, B> Pool<Server<H, T>, F, B>
pub fn slot_id_range(&self) -> Range<usize>
pub fn conn_slot_count(&self) -> usize
pub fn protocol(&self) -> &H
pub fn protocol_mut(&mut self) -> &mut H
pub fn listener_fd(&self) -> &FdHandle
Trait Implementations§
Source§impl<D, F, B> CompletionRouter<B> for Pool<D, F, B>
impl<D, F, B> CompletionRouter<B> for Pool<D, F, B>
fn on_complete(&mut self, driver: &mut B::Driver, ev: Completion<B>)
Source§impl<P, T, S, F, B> PoolTick<B> for Pool<Client<P, T, S>, F, B>where
P: ClientProtocol,
T: Transport,
T::Addr: Clone,
S: ConnectSource<T>,
F: Profile,
B: PoolDriver,
impl<P, T, S, F, B> PoolTick<B> for Pool<Client<P, T, S>, F, B>where
P: ClientProtocol,
T: Transport,
T::Addr: Clone,
S: ConnectSource<T>,
F: Profile,
B: PoolDriver,
Auto Trait Implementations§
impl<D, F, B> Freeze for Pool<D, F, B>where
D: Freeze,
impl<D, F, B> RefUnwindSafe for Pool<D, F, B>where
D: RefUnwindSafe,
F: RefUnwindSafe,
<D as Direction<B>>::Transport: RefUnwindSafe,
<D as Direction<B>>::CodecLayer: RefUnwindSafe,
B: RefUnwindSafe,
<<D as Direction<B>>::CodecLayer as CodecLayer>::WriteBuf: RefUnwindSafe,
<<D as Direction<B>>::CodecLayer as CodecLayer>::ConnState: RefUnwindSafe,
<D as Direction<B>>::SlotUser: RefUnwindSafe,
impl<D, F, B> !Send for Pool<D, F, B>
impl<D, F, B> !Sync for Pool<D, F, B>
impl<D, F, B> Unpin for Pool<D, F, B>where
D: Unpin,
F: Unpin,
<D as Direction<B>>::Transport: Unpin,
<D as Direction<B>>::CodecLayer: Unpin,
B: Unpin,
<<D as Direction<B>>::CodecLayer as CodecLayer>::WriteBuf: Unpin,
<<D as Direction<B>>::CodecLayer as CodecLayer>::ConnState: Unpin,
<D as Direction<B>>::SlotUser: Unpin,
impl<D, F, B> UnsafeUnpin for Pool<D, F, B>where
D: UnsafeUnpin,
impl<D, F, B> UnwindSafe for Pool<D, F, B>where
D: UnwindSafe,
F: UnwindSafe,
<D as Direction<B>>::Transport: UnwindSafe,
<D as Direction<B>>::CodecLayer: UnwindSafe,
B: UnwindSafe,
<<D as Direction<B>>::CodecLayer as CodecLayer>::WriteBuf: RefUnwindSafe + UnwindSafe,
<<D as Direction<B>>::CodecLayer as CodecLayer>::ConnState: RefUnwindSafe + UnwindSafe,
<D as Direction<B>>::SlotUser: RefUnwindSafe + UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more