Struct iocp::IoCompletionPort [-]  [+] [src]

pub struct IoCompletionPort {
    // some fields omitted
}

Represents an I/O completion port.

Methods

impl IoCompletionPort

fn new(concurrent_threads: usize) -> IocpResult<IoCompletionPort>

Create a new IoCompletionPort with the specified number of concurrent threads.

If zero threads are specified, the system allows as many concurrently running threads as there are processors in the system.

fn associate(&self, handle: HANDLE, completion_key: usize) -> IocpResult<()>

Assoicates the given file handle with this IoCompletionPort.

The completion key is included in every I/O completion packet for the specified file handle.

fn get_queued(&self, timeout: u32) -> IocpResult<CompletionStatus>

Attempts to dequeue an I/O completion packet from the IoCompletionPort.

fn get_many_queued(&self, buf: &mut [CompletionStatus], timeout: u32) -> IocpResult<usize>

Attempts to dequeue multiple I/O completion packets from the IoCompletionPort simultaneously.

Returns the number of CompletionStatus objects dequeued.

fn post_queued(&self, packet: CompletionStatus) -> IocpResult<()>

Posts an I/O completion packet to the IoCompletionPort.

Note that the OVERLAPPED structure in the CompletionStatus does not have to be valid (it can be a null pointer). Ensure that if you intend to post an OVERLAPPED structure, it is not freed until the CompletionStatus is dequeued.

Trait Implementations

impl Send for IoCompletionPort

impl Sync for IoCompletionPort

impl Clone for IoCompletionPort

fn clone(&self) -> IoCompletionPort

fn clone_from(&mut self, source: &Self)