pub struct Session<State> { /* private fields */ }
Implementations§
Source§impl<State: Clone> Session<State>
impl<State: Clone> Session<State>
pub fn new( id: ConnectionID, session_id: SessionID, ip: SocketAddr, sender: UnboundedSender<SendInformation>, config_manager: ConfigManager, cancel_token: CancellationToken, state: State, ) -> Result<Self>
pub fn is_disconnected(&self) -> bool
pub fn send<T: Serialize>(&self, message: T) -> Result<()>
pub fn send_raw(&self, message: Buffer) -> Result<()>
pub fn shutdown(&self)
pub fn disconnect(&self)
pub fn ban(&self)
pub fn needs_ban(&self) -> bool
pub fn id(&self) -> &ConnectionID
pub fn register_worker( &self, session_id: SessionID, client: Option<String>, worker_name: Option<String>, worker_id: Uuid, )
pub fn unregister_worker( &self, session_id: SessionID, ) -> Option<(SessionID, Miner)>
pub fn get_miner_list(&self) -> MinerList
pub fn get_worker_by_session_id(&self, session_id: SessionID) -> Option<Miner>
pub fn update_worker_by_session_id(&self, session_id: SessionID, miner: Miner)
pub fn set_client(&self, client: &str)
pub fn get_connection_info(&self) -> SessionInfo
pub fn is_long_timeout(&self) -> bool
pub fn timeout(&self) -> Duration
pub fn get_session_id(&self) -> SessionID
pub fn subscribed(&self) -> bool
pub fn subscribe(&self)
pub fn is_agent(&self) -> bool
pub fn set_difficulty(&self, session_id: SessionID, difficulty: Difficulty)
pub fn set_default_difficulty(&self, difficulty: Difficulty)
pub fn set_minimum_difficulty(&self, difficulty: Difficulty)
pub fn get_difficulties(&self, session_id: SessionID) -> Option<Difficulties>
pub fn state(&self) -> &State
pub fn update_difficulty(&self, session_id: SessionID) -> Option<Difficulty>
pub fn ip(&self) -> SocketAddr
Trait Implementations§
Auto Trait Implementations§
impl<State> Freeze for Session<State>
impl<State> !RefUnwindSafe for Session<State>
impl<State> Send for Session<State>
impl<State> Sync for Session<State>
impl<State> Unpin for Session<State>
impl<State> !UnwindSafe for Session<State>
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