pub struct ConnectionEventBuilder { /* private fields */ }Expand description
Builder for constructing connection events.
Events are automatically sent when the builder is dropped,
or can be explicitly sent with finish().
Implementations§
Source§impl ConnectionEventBuilder
impl ConnectionEventBuilder
Sourcepub fn auth_failed(self) -> Self
pub fn auth_failed(self) -> Self
Set authentication as failed.
Sourcepub fn target(
self,
host: impl Into<String>,
port: u16,
target_type: TargetType,
) -> Self
pub fn target( self, host: impl Into<String>, port: u16, target_type: TargetType, ) -> Self
Set the target information.
Sourcepub fn add_packets(&mut self, sent: u64, recv: u64)
pub fn add_packets(&mut self, sent: u64, recv: u64)
Add packets to the packet counters (for UDP).
Sourcepub fn event_mut(&mut self) -> &mut ConnectionEvent
pub fn event_mut(&mut self) -> &mut ConnectionEvent
Get a mutable reference to the event for direct modification.
Sourcepub fn finish(self, close_reason: CloseReason)
pub fn finish(self, close_reason: CloseReason)
Finish and send the event with the given close reason.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionEventBuilder
impl RefUnwindSafe for ConnectionEventBuilder
impl Send for ConnectionEventBuilder
impl Sync for ConnectionEventBuilder
impl Unpin for ConnectionEventBuilder
impl UnwindSafe for ConnectionEventBuilder
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