Skip to main content

ConnectionEvent

Struct ConnectionEvent 

Source
pub struct ConnectionEvent {
Show 27 fields pub timestamp: OffsetDateTime, pub duration_ms: u64, pub conn_id: u64, pub peer_ip: IpAddr, pub peer_port: u16, pub user_id: String, pub auth_result: AuthResult, pub target_type: TargetType, pub target_host: String, pub target_port: u16, pub sni: String, pub bytes_sent: u64, pub bytes_recv: u64, pub packets_sent: u64, pub packets_recv: u64, pub protocol: Protocol, pub transport: Transport, pub close_reason: CloseReason, pub is_fallback: bool, pub peer_country: String, pub peer_region: String, pub peer_city: String, pub peer_asn: u32, pub peer_org: String, pub peer_longitude: f64, pub peer_latitude: f64, pub server_id: String,
}
Expand description

A connection event representing the full lifecycle of a single connection.

Fields§

§timestamp: OffsetDateTime

Connection start time (UTC).

§duration_ms: u64

Connection duration in milliseconds.

§conn_id: u64

Connection ID (unique within server instance).

§peer_ip: IpAddr

Client IP address.

§peer_port: u16

Client port.

§user_id: String

User identifier (password hash prefix or custom ID).

§auth_result: AuthResult

Authentication result.

§target_type: TargetType

Target address type.

§target_host: String

Target host (IP or domain).

§target_port: u16

Target port.

§sni: String

SNI (Server Name Indication), if available.

§bytes_sent: u64

Bytes sent (client → server → target).

§bytes_recv: u64

Bytes received (target → server → client).

§packets_sent: u64

Packets sent (UDP only).

§packets_recv: u64

Packets received (UDP only).

§protocol: Protocol

Protocol type.

§transport: Transport

Transport layer.

§close_reason: CloseReason

Connection close reason.

§is_fallback: bool

Whether this was a fallback connection.

§peer_country: String

Source country ISO 3166-1 alpha-2 code (e.g., “CN”, “US”).

§peer_region: String

Source region/state/province (e.g., “Shanghai”, “California”).

§peer_city: String

Source city (e.g., “Shanghai”, “Los Angeles”).

§peer_asn: u32

Source ASN number (e.g., 4134).

§peer_org: String

Source ASN organization (e.g., “China Telecom”).

§peer_longitude: f64

Source longitude.

§peer_latitude: f64

Source latitude.

§server_id: String

Server instance ID.

Implementations§

Source§

impl ConnectionEvent

Source

pub fn new(conn_id: u64, peer_ip: IpAddr, peer_port: u16) -> Self

Create a new connection event with default values.

Trait Implementations§

Source§

impl Clone for ConnectionEvent

Source§

fn clone(&self) -> ConnectionEvent

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ConnectionEvent

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ConnectionEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ConnectionEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Row for ConnectionEvent

Auto Trait Implementations§

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<S> Bind for S
where S: Serialize,

Source§

fn write(&self, dst: &mut impl Write) -> Result<(), String>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Is for T
where T: ?Sized,

Source§

type EqTo = T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<R> RowOwned for R
where R: 'static + for<'a> Row<Value<'a> = R>,

Source§

impl<R> RowRead for R
where R: for<'a> Row, <R as Row>::Value<'a>: for<'a> Deserialize<'a>,

Source§

impl<R> RowWrite for R
where R: for<'a> Row, <R as Row>::Value<'a>: for<'a> Serialize,