pub struct Connection { /* private fields */ }Expand description
Represents an individual client connection.
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn new(
id: u64,
stream: TcpStream,
handler: Arc<dyn Handler>,
config: ConnectionConfig,
) -> Self
pub fn new( id: u64, stream: TcpStream, handler: Arc<dyn Handler>, config: ConnectionConfig, ) -> Self
Create a new connection wrapper with a monotonically increasing id.
Sourcepub async fn run(self) -> Result<(), ConnectionError>
pub async fn run(self) -> Result<(), ConnectionError>
Drive the connection until it terminates, handling pipelined requests in order.
Auto Trait Implementations§
impl !Freeze for Connection
impl !RefUnwindSafe for Connection
impl !UnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
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