[][src]Struct ndk::looper::ThreadLooper

pub struct ThreadLooper { /* fields omitted */ }

A thread-local ALooper. This contains a native ALooper * and promises that there is a looper associated with the current thread.

Implementations

impl ThreadLooper[src]

pub fn prepare() -> Self[src]

Prepares a looper for the current thread and returns it

pub fn for_thread() -> Option<Self>[src]

Returns the looper associated with the current thread, if any.

pub fn poll_once(&self) -> Result<Poll, LooperError>[src]

Polls the looper, blocking on processing an event.

pub fn poll_once_timeout(&self, timeout: Duration) -> Result<Poll, LooperError>[src]

Polls the looper, blocking on processing an event, but with a timeout. Give a timeout of 0 to make this non-blocking.

It panics if the timeout is larger than expressible as an i32 of milliseconds (roughly 25 days).

pub fn poll_all(&self) -> Result<Poll, LooperError>[src]

Repeatedly polls the looper, blocking on processing an event.

This function will never return Poll::Callback.

pub fn poll_all_timeout(&self, timeout: Duration) -> Result<Poll, LooperError>[src]

Repeatedly polls the looper, blocking on processing an event, but with a timeout. Give a timeout of 0 to make this non-blocking.

This function will never return Poll::Callback.

It panics if the timeout is larger than expressible as an i32 of milliseconds (roughly 25 days).

pub fn as_foreign(&self) -> &ForeignLooper[src]

Returns a reference to the ForeignLooper that is associated with the current thread.

pub fn into_foreign(self) -> ForeignLooper[src]

Trait Implementations

impl Debug for ThreadLooper[src]

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<'a, T> Desc<'a, T> for T

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

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

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.