[][src]Struct libuv::handles::async::AsyncHandle

pub struct AsyncHandle { /* fields omitted */ }

Async handles allow the user to “wakeup” the event loop and get a callback called from another thread.

Implementations

impl AsyncHandle[src]

pub fn new<CB: Into<AsyncCB<'static>>>(
    r#loop: &Loop,
    cb: CB
) -> Result<AsyncHandle>
[src]

Create and initialize a new async handle

pub fn send(&mut self) -> Result<()>[src]

Wake up the event loop and call the async handle’s callback.

Note: It’s safe to call this function from any thread. The callback will be called on the loop thread.

Note: uv_async_send() is async-signal-safe. It’s safe to call this function from a signal handler.

Warning: libuv will coalesce calls to send(), that is, not every call to it will yield an execution of the callback. For example: if send() is called 5 times in a row before the callback is called, the callback will only be called once. If send() is called again after the callback was called, it will be called again.

Trait Implementations

impl Clone for AsyncHandle[src]

impl Copy for AsyncHandle[src]

impl From<AsyncHandle> for Handle[src]

impl HandleTrait for AsyncHandle[src]

impl Send for AsyncHandle[src]

impl Sync for AsyncHandle[src]

impl ToHandle for AsyncHandle[src]

impl TryFrom<Handle> for AsyncHandle[src]

type Error = ConversionError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.