pub struct Connection {
pub peer_address: Result<SocketAddr>,
/* private fields */
}
Expand description
A struct representing a HTTP connection between a client and the server
Fields§
§peer_address: Result<SocketAddr>
The address of the peer client (if known)
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn new(stream: TcpStream) -> Self
pub fn new(stream: TcpStream) -> Self
Create a new Connection
from a TcpStream
Sourcepub fn terminate_connection(&self)
pub fn terminate_connection(&self)
Terminates the connection between the client and the server
Note: the Connection
struct shouldn’t be used after this function returns
Auto Trait Implementations§
impl Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe 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