Skip to main content

Pool

Struct Pool 

Source
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>

Source

pub fn poke_outbound( &mut self, driver: &mut B::Driver, conn_id: SlotId, ) -> Result<(), PushError>

Source

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>

Source

pub fn new( direction: Client<P, T, S>, max_conn: usize, slot_id_base: usize, ) -> Result<Self>

Source

pub fn slot_id_range(&self) -> Range<usize>

Source

pub fn conn_slot_count(&self) -> usize

Source

pub fn direction_mut(&mut self) -> &mut Client<P, T, S>

Source

pub fn live_conns(&self) -> impl Iterator<Item = SlotId> + '_

Source

pub fn is_live(&self, conn_id: SlotId) -> bool

Source

pub fn session_mut(&mut self, conn_id: SlotId) -> Option<&mut ClientSession<P>>

Source

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<P, S, F, B> Pool<Client<P, Tcp, S>, F, B>

Source

pub fn build( protocol: P, connect_source: S, cfg: TcpClientConfig, ) -> Result<Runtime<Self>>

Source

pub fn build_raw( protocol: P, connect_source: S, cfg: TcpClientConfig, _driver: &mut B::Driver, slot_id_base: usize, ) -> Result<Self>

Source§

impl<H: ServerProtocol, T: Transport, F: Profile, B: PoolDriver> Pool<Server<H, T>, F, B>

Source

pub fn push_response( &mut self, driver: &mut B::Driver, conn_id: SlotId, bytes: &[u8], close_after: bool, ) -> Result<(), PushError>

Source§

impl<H, F, B> Pool<Server<H, Tcp>, F, B>

Source

pub fn build(protocol: H, cfg: TcpServerConfig) -> Result<Runtime<Self>>

Source

pub fn build_raw( protocol: H, cfg: TcpServerConfig, driver: &mut B::Driver, slot_id_base: usize, ) -> Result<Self>

Source§

impl<H, T, F, B> Pool<Server<H, T>, F, B>

Source

pub fn slot_id_range(&self) -> Range<usize>

Source

pub fn conn_slot_count(&self) -> usize

Source

pub fn protocol(&self) -> &H

Source

pub fn protocol_mut(&mut self) -> &mut H

Source

pub fn listener_fd(&self) -> &FdHandle

Trait Implementations§

Source§

impl<D, F, B> CompletionRouter<B> for Pool<D, F, B>
where D: Direction<B>, F: Profile, B: PoolDriver, Self: PoolRecv<B> + PoolWrite<B>,

Source§

fn on_complete(&mut self, driver: &mut B::Driver, ev: Completion<B>)

Source§

impl<D, F, B> Manifold for Pool<D, F, B>
where D: Direction<B>, F: Profile, B: PoolDriver, Self: PoolTick<B> + CompletionRouter<B>,

Source§

type Backend = B

Source§

fn has_pending(&self, _driver: &mut B::Driver) -> bool

Source§

fn drive(&mut self, driver: &mut B::Driver)

Source§

fn park_timeout(&mut self) -> Option<Duration>

Source§

impl<P, T, S, F, B> PoolTick<B> for Pool<Client<P, T, S>, F, B>

Source§

fn tick(&mut self, driver: &mut B::Driver)

Source§

impl<H, T, F, B> PoolTick<B> for Pool<Server<H, T>, F, B>

Source§

fn tick(&mut self, driver: &mut B::Driver)

Auto Trait Implementations§

§

impl<D, F, B> !Send for Pool<D, F, B>

§

impl<D, F, B> !Sync for Pool<D, F, B>

§

impl<D, F, B> Freeze for Pool<D, F, B>
where D: Freeze,

§

impl<D, F, B> RefUnwindSafe 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, <D as Direction<B>>::WriteBuf: Unpin, B: 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>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more