Struct redcon::Conn

source · []
pub struct Conn {
    pub context: Option<Box<dyn Any>>,
    /* private fields */
}
Expand description

A client connection.

Fields

context: Option<Box<dyn Any>>

A custom user-defined context.

Implementations

A distinct identifier for the connection.

The connection socket address.

Read the next command in the pipeline, if any.

This method is not typically needed, but it can be used for reading additional incoming commands that may be present. Which, may come in handy for specialized stuff like batching operations or for optimizing a locking strategy.

Write a RESP Simple String to client connection.

https://redis.io/docs/reference/protocol-spec/#resp-simple-strings

Write a RESP Null Bulk String to client connection.

https://redis.io/docs/reference/protocol-spec/#resp-bulk-strings

Write a RESP Error to client connection.

https://redis.io/docs/reference/protocol-spec/#resp-errors

Write a RESP Integer to client connection.

https://redis.io/docs/reference/protocol-spec/#resp-errors

Write a RESP Array to client connection.

https://redis.io/docs/reference/protocol-spec/#resp-arrays

Write a RESP Bulk String to client connection.

https://redis.io/docs/reference/protocol-spec/#resp-simple-strings

Write raw bytes to the client connection.

Close the client connection.

Shutdown the server that was started by Server::serve.

This operation will gracefully shutdown the server by closing the all client connections, stopping the server listener, and waiting for the server resources to free.

Close a client connection that is not this one.

The identifier is for a client connection that was connection to the same server as self. This operation can safely be called on the same identifier multiple time.

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.

Calls U::from(self).

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

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.