pub struct ConnQueue {
queue: Mutex<VecDeque<Connection>>,
conn_available: CondVar,
}
Expand description
Connection queue
Fields§
§queue: Mutex<VecDeque<Connection>>
§conn_available: CondVar
Implementations§
Source§impl ConnQueue
impl ConnQueue
pub fn new() -> Arc<Self>
Sourcepub async fn handle(
&self,
conn: Conn<NetMsg, Error>,
direction: ConnDirection,
) -> Result<()>
pub async fn handle( &self, conn: Conn<NetMsg, Error>, direction: ConnDirection, ) -> Result<()>
Handle a connection by pushing it into the queue and wait for the disconnect signal
Sourcepub async fn next(&self) -> Connection
pub async fn next(&self) -> Connection
Waits for the next connection in the queue
Auto Trait Implementations§
impl !Freeze for ConnQueue
impl !RefUnwindSafe for ConnQueue
impl Send for ConnQueue
impl Sync for ConnQueue
impl !Unpin for ConnQueue
impl !UnwindSafe for ConnQueue
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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