[−][src]Struct libuv::handles::async::AsyncHandle
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]
r#loop: &Loop,
cb: CB
) -> Result<AsyncHandle>
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]
fn clone(&self) -> AsyncHandle
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for AsyncHandle
[src]
impl From<AsyncHandle> for Handle
[src]
fn from(r#async: AsyncHandle) -> Handle
[src]
impl HandleTrait for AsyncHandle
[src]
fn is_active(&self) -> bool
[src]
fn is_closing(&self) -> bool
[src]
fn close<CB: Into<CloseCB<'static>>>(&mut self, cb: CB)
[src]
fn ref(&mut self)
[src]
fn unref(&mut self)
[src]
fn has_ref(&self) -> bool
[src]
fn send_buffer_size(&mut self, value: i32) -> Result<i32>
[src]
fn recv_buffer_size(&mut self, value: i32) -> Result<i32>
[src]
fn get_fileno(&self) -> Result<OsFile>
[src]
fn get_loop(&self) -> Loop
[src]
fn get_type(&self) -> HandleType
[src]
impl Send for AsyncHandle
[src]
impl Sync for AsyncHandle
[src]
impl ToHandle for AsyncHandle
[src]
impl TryFrom<Handle> for AsyncHandle
[src]
Auto Trait Implementations
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,