Struct mio::windows::Binding [] [src]

pub struct Binding { /* fields omitted */ }

A Binding is embedded in all I/O objects associated with a Poll object.

Each registration keeps track of which selector the I/O object is associated with, ensuring that implementations of Evented can be conformant for the various methods on Windows.

If you're working with custom IOCP-enabled objects then you'll want to ensure that one of these instances is stored in your object and used in the implementation of Evented.

For more information about how to use this see the windows module documentation in this crate.

Methods

impl Binding
[src]

Creates a new blank binding ready to be inserted into an I/O object.

Won't actually do anything until associated with a Poll loop.

Registers a new handle with the Poll specified, also assigning the token specified.

This function is intended to be used as part of Evented::register for custom IOCP objects. It will add the specified handle to the internal IOCP object with the provided token. All future events generated by the handled provided will be received by the Poll's internal IOCP object.

Unsafety

This function is unsafe as the Poll instance has assumptions about what the OVERLAPPED pointer used for each I/O operation looks like. Specifically they must all be instances of the Overlapped type in this crate. More information about this can be found on the windows module in this crate.

Same as register_handle but for sockets.

Reregisters the handle provided from the Poll provided.

This is intended to be used as part of Evented::reregister but note that this function does not currently reregister the provided handle with the poll specified. IOCP has a special binding for changing the token which has not yet been implemented. Instead this function should be used to assert that the call to reregister happened on the same Poll that was passed into to register.

Eventually, though, the provided handle will be re-assigned to have the token token on the given poll assuming that it's been previously registered with it.

Unsafety

This function is unsafe for similar reasons to register. That is, there may be pending I/O events and such which aren't handled correctly.

Same as reregister_handle, but for sockets.

Deregisters the handle provided from the Poll provided.

This is intended to be used as part of Evented::deregister but note that this function does not currently deregister the provided handle from the poll specified. IOCP has a special binding for that which has not yet been implemented. Instead this function should be used to assert that the call to deregister happened on the same Poll that was passed into to register.

Unsafety

This function is unsafe for similar reasons to register. That is, there may be pending I/O events and such which aren't handled correctly.

Same as deregister_handle, but for sockets.

Trait Implementations

impl Debug for Binding
[src]

Formats the value using the given formatter.