pub struct Connection<S> where
    S: AsyncRead + AsyncWrite + Send + Unpin + Debug
{ pub kind: ConnectionKind, pub server_name: String, pub timestamp: SystemTime, pub is_alive: bool, pub config: Arc<Config>, pub client_addr: SocketAddr, pub server_addr: SocketAddr, pub error_count: i64, pub is_secured: bool, pub is_authenticated: bool, pub authentication_attempt: i64, pub inner: AbstractIO<S>, }
Expand description

Instance containing connection to the server’s information

Fields

kind: ConnectionKind

server’s port

server_name: String

server’s domain of the connection, (from config.server.domain or sni)

timestamp: SystemTime

connection timestamp

is_alive: bool

is still alive

config: Arc<Config>

server’s configuration

client_addr: SocketAddr

peer socket address

server_addr: SocketAddr

address used for this connection

error_count: i64

number of error the client made so far

is_secured: bool

is under tls (tunneled or opportunistic)

is_authenticated: bool

has completed SASL challenge (AUTH)

authentication_attempt: i64

number of time the AUTH command has been received (and failed)

inner: AbstractIO<S>

inner stream

Implementations

send a reply code to the client

Errors

Send a buffer

Errors
  • internal connection writer error

Read a line from the client

Errors
  • timed-out
  • internal connection reader error

Receives the incomings mail of a connection

Errors
  • server failed to send a message
  • a transaction failed
  • the pre-queue processing of the mail failed

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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