pub struct RouterState {
pub conns: HashMap<String, usize>,
pub last_active: HashMap<String, i64>,
pub cancel: HashMap<(i32, Vec<u8>), String>,
pub status: RouterStatus,
/* private fields */
}Expand description
What the router knows about open connections; read through Ctx::router.
Fields§
§conns: HashMap<String, usize>Clone id → open router connections.
last_active: HashMap<String, i64>Clone id → unix time of the last router connect or disconnect.
cancel: HashMap<(i32, Vec<u8>), String>(pid, secret key) from BackendKeyData → clone id, for cancel requests.
status: RouterStatusImplementations§
Source§impl RouterState
impl RouterState
pub fn new(port: u16) -> RouterState
pub fn open_conns(&self, id: &str) -> usize
pub fn last_active(&self, id: &str) -> Option<i64>
Sourcepub fn close_clone(&mut self, id: &str)
pub fn close_clone(&mut self, id: &str)
Closes every client connection to clone id (on destroy or sleep).
Auto Trait Implementations§
impl Freeze for RouterState
impl RefUnwindSafe for RouterState
impl Send for RouterState
impl Sync for RouterState
impl Unpin for RouterState
impl UnsafeUnpin for RouterState
impl UnwindSafe for RouterState
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