[][src]Struct fluvio_socket::SocketPool

pub struct SocketPool<T> where
    T: Eq + Hash
{ /* fields omitted */ }

pooling of sockets

Implementations

impl<T> SocketPool<T> where
    T: Eq + PartialEq + Hash + Debug + Clone,
    FlvSocket: Sync
[src]

pub fn new() -> Self[src]

pub fn insert_socket(&self, id: T, socket: FlvSocket)[src]

pub fn get_socket(&self, id: &T) -> Option<WriteGuard<'_, T, FlvSocket>>[src]

get valid client. return only client which is not stale

impl<T> SocketPool<T> where
    T: Eq + PartialEq + Hash + Debug + Clone + ToString,
    FlvSocket: Sync
[src]

pub async fn make_connection(&self, id: T) -> Result<(), FlvSocketError>[src]

make connection where id can be used as address

impl<T> SocketPool<T> where
    T: Eq + PartialEq + Hash + Debug + Clone,
    FlvSocket: Sync
[src]

pub async fn make_connection_with_addr(
    &self,
    id: T,
    addr: &str
) -> Result<(), FlvSocketError>
[src]

make connection with addres as separate parameter

pub async fn get_or_make<'a>(
    &'a self,
    id: T,
    addr: &'a str
) -> Result<Option<WriteGuard<'a, T, FlvSocket>>, FlvSocketError>
[src]

get existing socket connection or make new one

Trait Implementations

impl<T: Debug> Debug for SocketPool<T> where
    T: Eq + Hash
[src]

impl<T> Default for SocketPool<T> where
    T: Eq + PartialEq + Hash + Debug + Clone
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for SocketPool<T>[src]

impl<T> Send for SocketPool<T> where
    T: Send
[src]

impl<T> Sync for SocketPool<T> where
    T: Send + Sync
[src]

impl<T> Unpin for SocketPool<T> where
    T: Unpin
[src]

impl<T> !UnwindSafe for SocketPool<T>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.