Struct stratum_server::ConnectionList
source · [−]pub struct ConnectionList<CState: Clone + Sync + Send + 'static> {
pub miners: RwLock<HashMap<SocketAddr, Arc<Connection<CState>>>>,
pub max_connections: Option<usize>,
}
Fields
miners: RwLock<HashMap<SocketAddr, Arc<Connection<CState>>>>
max_connections: Option<usize>
Implementations
sourceimpl<CState: Clone + Sync + Send + 'static> ConnectionList<CState>
impl<CState: Clone + Sync + Send + 'static> ConnectionList<CState>
pub fn new(max_connections: Option<usize>) -> Self
pub async fn add_miner(
&self,
addr: SocketAddr,
miner: Arc<Connection<CState>>
) -> Result<()>
pub async fn remove_miner(&self, addr: SocketAddr)
pub async fn get_all_miners(&self) -> Vec<Arc<Connection<CState>>>
pub async fn len(&self) -> usize
pub async fn is_empty(&self) -> bool
pub async fn is_full(&self) -> bool
pub async fn shutdown(&self) -> Result<()>
Trait Implementations
Auto Trait Implementations
impl<CState> !RefUnwindSafe for ConnectionList<CState>
impl<CState> Send for ConnectionList<CState>
impl<CState> Sync for ConnectionList<CState>
impl<CState> Unpin for ConnectionList<CState>
impl<CState> !UnwindSafe for ConnectionList<CState>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more