#[non_exhaustive]pub enum Operation {
Accept {
listener: Token,
},
Receive {
token: Token,
buffer: Buffer,
},
ReceiveZero {
token: Token,
},
Send {
token: Token,
chunks: SendChunks,
},
SendFile {
token: Token,
file: Arc<File>,
offset: u64,
len: u32,
},
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
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.
SendFile
Sends up to len bytes of file from offset, zero copy where the OS can. The
result says how many went out; Ok(0) means the file has nothing there.
Fields
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).