pub struct ConnectionState {
pub channels_by_cid: HashMap<u32, ChannelInfo>,
pub sid_to_cid: HashMap<u32, u32>,
pub operations: HashMap<u32, OperationState>,
pub is_be: bool,
pub last_seen: Instant,
pub update_times: VecDeque<Instant>,
pub recent_messages: VecDeque<String>,
}Expand description
Per-connection state
Fields§
§channels_by_cid: HashMap<u32, ChannelInfo>Channels indexed by Client ID
sid_to_cid: HashMap<u32, u32>Server ID → Client ID mapping
operations: HashMap<u32, OperationState>Operations indexed by IOID
is_be: boolByte order for this connection (true = big endian)
last_seen: InstantLast activity on this connection
update_times: VecDeque<Instant>§recent_messages: VecDeque<String>Implementations§
Source§impl ConnectionState
impl ConnectionState
pub fn new() -> Self
pub fn touch(&mut self)
Sourcepub fn get_channel_by_sid(&self, sid: u32) -> Option<&ChannelInfo>
pub fn get_channel_by_sid(&self, sid: u32) -> Option<&ChannelInfo>
Get channel info by Server ID
Sourcepub fn get_channel_by_sid_mut(&mut self, sid: u32) -> Option<&mut ChannelInfo>
pub fn get_channel_by_sid_mut(&mut self, sid: u32) -> Option<&mut ChannelInfo>
Get mutable channel info by Server ID
Sourcepub fn get_pv_name_by_sid(&self, sid: u32) -> Option<&str>
pub fn get_pv_name_by_sid(&self, sid: u32) -> Option<&str>
Get PV name for a Server ID
Sourcepub fn get_pv_name_by_ioid(&self, ioid: u32) -> Option<&str>
pub fn get_pv_name_by_ioid(&self, ioid: u32) -> Option<&str>
Get PV name for an operation IOID
Trait Implementations§
Source§impl Debug for ConnectionState
impl Debug for ConnectionState
Auto Trait Implementations§
impl Freeze for ConnectionState
impl RefUnwindSafe for ConnectionState
impl Send for ConnectionState
impl Sync for ConnectionState
impl Unpin for ConnectionState
impl UnsafeUnpin for ConnectionState
impl UnwindSafe for ConnectionState
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