pub struct PollRegistry { /* private fields */ }
Implementations§
Source§impl PollRegistry
impl PollRegistry
Sourcepub fn register<S: Source + ?Sized>(
&self,
handle: &mut S,
interest: Interest,
wakers: SourceWaker,
) -> IoResult<Token>
pub fn register<S: Source + ?Sized>( &self, handle: &mut S, interest: Interest, wakers: SourceWaker, ) -> IoResult<Token>
Registers a [mio::Evented
] handle in the wrapped mio::Poll
, along with a
std::task::Waker
, allowing an async wrapper of the given handle to be woken. This
abstracts the mio::Poll
<-> mio::Token
relationship to allow a reactor to wake
wrapped handlers.
§Panics
This function may panic if there are more than usize
concurrent handlers registered.
This is highly unlikely in most practical cases, as process sharding is essentially
guaranteed to be needed before that number of handlers is reached.
Trait Implementations§
impl Sync for PollRegistry
§Safety
The factor that prevents it from being interpreted as safe is the Sender for Token values. The
Registry only has a copy for the sake of making copies for Tokens. As long as the Registry
doesn’t use token_drop_box
itself, this is safe.
Auto Trait Implementations§
impl !Freeze for PollRegistry
impl RefUnwindSafe for PollRegistry
impl Send for PollRegistry
impl Unpin for PollRegistry
impl UnwindSafe for PollRegistry
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