[−][src]Struct mirai::PollRegistry
Methods
impl PollRegistry
[src]
impl PollRegistry
[src]
pub fn register<S: Source + ?Sized>(
&self,
handle: &mut S,
interest: Interest,
wakers: SourceWaker
) -> IoResult<Token>
[src]
&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
[src]
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 !RefUnwindSafe for PollRegistry
impl Send for PollRegistry
impl Unpin for PollRegistry
impl !UnwindSafe for PollRegistry
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,