#[non_exhaustive]pub enum Operation {
Accept {
listener: Token,
},
Receive {
token: Token,
buffer: Buffer,
},
ReceiveZero {
token: Token,
},
Send {
token: Token,
chunks: SendChunks,
},
Connect {
token: Token,
addr: SocketAddr,
},
Close {
token: Token,
abortive: bool,
},
Nop {
token: Token,
},
}Expand description
What to do on a registered socket. The operation owns its buffers until its completion returns them.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Accept
Completes when a connection is waiting (accept it from the listener). Refused on Windows, where a listener is never registered (D-016).
Receive
Receives into buffer’s spare room (at most once); Ok(0) is end of stream.
ReceiveZero
Completes when bytes can be read, without holding a buffer: idle connections wait this way.
Send
Sends what chunks holds; the result says how many bytes went out, which
can be fewer than all of them. The chunks come back with the completion.
Connect
Connects a registered, non-blocking socket.
Close
Completes once every other operation on the socket has; the caller then closes it. Abortive when asked (linger 0).
Nop
Completes at once (a turn of the loop).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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