Skip to main content

Event

Enum Event 

Source
#[non_exhaustive]
pub enum Event {
Show 23 variants ListenerOpened { listener: ListenerId, local: Option<SocketAddr>, backlog: Option<u32>, }, ListenerClosed { listener: ListenerId, }, DoorOpened, DoorClosed, Accepted { id: ConnectionId, peer: Option<SocketAddr>, listener: ListenerId, }, Refused { peer: Option<SocketAddr>, cause: RefusalCause, }, Admitted { id: ConnectionId, lane: Lane, }, ProxyResolved { id: ConnectionId, real_peer: SocketAddr, }, HandshakeDone { id: ConnectionId, took: Duration, }, LimitHit { id: Option<ConnectionId>, which: LimitKind, }, Killed { id: ConnectionId, reason: KillReason, }, EgressDenied { id: ConnectionId, code: u16, }, Closed { id: ConnectionId, reason: CloseReason, bytes_in: u64, bytes_out: u64, lifetime: Duration, }, AcceptError { listener: ListenerId, class: OsErrorClass, }, DescriptorPressure { listener: ListenerId, backoff: Duration, }, ListenerFailed { listener: ListenerId, class: OsErrorClass, }, DrainStarted { open: u32, }, DrainFinished { graceful: u32, killed: u32, }, ControlReacted { state: ControlState, }, StaleCompletion { worker: WorkerId, }, SessionPanicked { id: ConnectionId, }, DriverFallback { wanted: DriverKind, using: DriverKind, }, Coalesced { kind: CoalescedKind, count: u32, },
}
Expand description

One event: fixed size, Copy, borrowing nothing.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ListenerOpened

A listener was bound.

Fields

§listener: ListenerId

The listener.

§local: Option<SocketAddr>

Its address.

§backlog: Option<u32>

The effective backlog, when known.

§

ListenerClosed

A listener was removed (Server::remove_listener); its socket is closed.

Fields

§listener: ListenerId

The listener.

§

DoorOpened

Accepting started.

§

DoorClosed

Accepting stopped.

§

Accepted

A connection was accepted.

Fields

§id: ConnectionId

The connection.

§peer: Option<SocketAddr>

Its peer.

§listener: ListenerId

The listener.

§

Refused

A connection was refused.

Fields

§peer: Option<SocketAddr>

Its peer.

§cause: RefusalCause

Why.

§

Admitted

The gate admitted a connection.

Fields

§id: ConnectionId

The connection.

§lane: Lane

Its lane.

§

ProxyResolved

A trusted PROXY header named the real client.

Fields

§id: ConnectionId

The connection.

§real_peer: SocketAddr

The real client.

§

HandshakeDone

The handshake finished.

Fields

§id: ConnectionId

The connection.

§took: Duration

How long it took.

§

LimitHit

A configured bound was hit.

Fields

§id: Option<ConnectionId>

The connection, if one.

§which: LimitKind

Which bound.

§

Killed

A connection was killed.

Fields

§id: ConnectionId

The connection.

§reason: KillReason

The caller’s code.

§

EgressDenied

The gate denied a write.

Fields

§id: ConnectionId

The connection.

§code: u16

The gate’s code.

§

Closed

A connection closed: exactly once per connection.

Fields

§id: ConnectionId

The connection.

§reason: CloseReason

Why.

§bytes_in: u64

Bytes received.

§bytes_out: u64

Bytes sent.

§lifetime: Duration

How long it was open.

§

AcceptError

An accept failed for a reason that affects only one connection.

Fields

§listener: ListenerId

The listener.

§class: OsErrorClass

The OS error class.

§

DescriptorPressure

The process ran out of descriptors; accepting pauses.

Fields

§listener: ListenerId

The listener.

§backoff: Duration

How long accepting pauses.

§

ListenerFailed

A listener failed and was closed.

Fields

§listener: ListenerId

The listener.

§class: OsErrorClass

The OS error class.

§

DrainStarted

A drain started.

Fields

§open: u32

Connections open when it started.

§

DrainFinished

A drain finished.

Fields

§graceful: u32

Connections that finished in time.

§killed: u32

Connections killed at the deadline.

§

ControlReacted

Workers reacted to a control-line change.

Fields

§state: ControlState

The new state.

§

StaleCompletion

A completion arrived for a connection that had closed.

Fields

§worker: WorkerId

The worker.

§

SessionPanicked

A session panicked; its connection was closed.

Fields

§id: ConnectionId

The connection.

§

DriverFallback

The requested driver could not run; another was used.

Fields

§wanted: DriverKind

The requested driver.

§using: DriverKind

The driver in use.

§

Coalesced

Refusals or limit hits above 1,000 per second per worker, folded into one event.

Fields

§kind: CoalescedKind

What was folded.

§count: u32

How many.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Event

Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.