pub struct EventContext { /* private fields */ }Expand description
Event context passed to event handlers.
Implementations§
Source§impl EventContext
impl EventContext
Sourcepub fn connection_id(&self) -> &str
pub fn connection_id(&self) -> &str
Returns the logical connection id for the current client.
Sourcepub fn peer_addr(&self) -> Option<SocketAddr>
pub fn peer_addr(&self) -> Option<SocketAddr>
Returns the peer socket address when available.
Sourcepub fn attachments(&self) -> &[FileAttachment]
pub fn attachments(&self) -> &[FileAttachment]
Returns attachments that accompanied the event.
Sourcepub fn server(&self) -> &ServerHandle
pub fn server(&self) -> &ServerHandle
Returns a server handle for outbound event operations.
Trait Implementations§
Source§impl Clone for EventContext
impl Clone for EventContext
Source§fn clone(&self) -> EventContext
fn clone(&self) -> EventContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EventContext
impl !RefUnwindSafe for EventContext
impl Send for EventContext
impl Sync for EventContext
impl Unpin for EventContext
impl UnsafeUnpin for EventContext
impl !UnwindSafe for EventContext
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