pub struct SocketIo<B> { /* private fields */ }Expand description
A pending socket operation submitted through AssociatedSocket::recv or
AssociatedSocket::send.
The token carries the operation’s identity and remembers the buffer type it
was submitted with, so SocketIo::claim hands back the caller’s own buffer
– the same value, not a copy – once the matching completion is dequeued.
Implementations§
Source§impl<B: IoBuf> SocketIo<B>
impl<B: IoBuf> SocketIo<B>
Sourcepub fn id(&self) -> OperationId
pub fn id(&self) -> OperationId
The identity of the in-flight operation, for cancellation or matching.
Sourcepub fn claim(self, completion: &Completion) -> Result<(B, Result<usize>), Self>
pub fn claim(self, completion: &Completion) -> Result<(B, Result<usize>), Self>
Claim this operation’s result from completion.
On a match returns Ok((buffer, result)): buffer is the one the caller
handed over – the bytes received (valid up to the byte count), or the
data sent – and result is the byte count or the operation’s error.
Returns Err(self) when completion belongs to a different operation.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for SocketIo<B>
impl<B> RefUnwindSafe for SocketIo<B>
impl<B> Send for SocketIo<B>
impl<B> Sync for SocketIo<B>
impl<B> Unpin for SocketIo<B>
impl<B> UnsafeUnpin for SocketIo<B>
impl<B> UnwindSafe for SocketIo<B>
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