pub struct PeerContext<T>where
T: Default,{
pub user_data: T,
/* private fields */
}
Fields§
§user_data: T
Implementations§
Source§impl<T> PeerContext<T>where
T: Default,
impl<T> PeerContext<T>where
T: Default,
pub fn set<K>(&mut self, key: K, value: Value) -> Option<Value>
pub fn contains_key(&self, key: &str) -> bool
pub fn get(&mut self, key: &str) -> Option<&Value>
pub fn get_mut(&mut self, key: &str) -> Option<&mut Value>
pub fn peer_addr(&self) -> &SocketAddr
pub fn local_addr(&self) -> &SocketAddr
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for PeerContext<T>where
T: Freeze,
impl<T> RefUnwindSafe for PeerContext<T>where
T: RefUnwindSafe,
impl<T> Send for PeerContext<T>where
T: Send,
impl<T> Sync for PeerContext<T>where
T: Sync,
impl<T> Unpin for PeerContext<T>where
T: Unpin,
impl<T> UnwindSafe for PeerContext<T>where
T: UnwindSafe,
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