pub struct Connection { /* private fields */ }Implementations§
Source§impl Connection
impl Connection
pub fn id(&self) -> ConnectionId
pub fn remote_addr(&self) -> SocketAddr
pub fn metadata(&self) -> ConnectionMetadata
pub fn close_reason(&self) -> Option<ConnectionCloseReason>
pub async fn send_bytes( &self, payload: impl Into<Bytes>, ) -> Result<(), SendQueueError>
pub async fn send( &self, payload: impl AsRef<[u8]>, ) -> Result<(), SendQueueError>
pub async fn send_compat( &self, stream: &[u8], _immediate: bool, ) -> Result<(), SendQueueError>
pub async fn recv_bytes(&mut self) -> Result<Bytes, RecvError>
pub async fn recv(&mut self) -> Result<Vec<u8>, RecvError>
pub async fn close(&self)
pub async fn is_closed(&self) -> bool
pub fn into_io(self) -> ConnectionIo
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin 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