[][src]Struct android_looper::LooperRef

pub struct LooperRef { /* fields omitted */ }

Reference to a looper.

From NDK docs:

A looper is the state tracking an event loop for a thread. Loopers do not define event structures or other such things; rather they are a lower-level facility to attach one or more discrete objects listening for an event. An "event" here is simply data available on a file descriptor: each attached object has an associated file descriptor, and waiting for "events" means (internally) polling on all of these file descriptors until one or more of them have data available.

A thread can have only one Looper associated with it.

Methods

impl LooperRef[src]

pub fn from_handle(handle: LooperHandle) -> LooperRef[src]

Create LooperRef from native handle.

pub fn prepare(opts: LooperPrepareOpts) -> Result<LooperRef>[src]

Prepares a looper associated with the calling thread, and returns it. If the thread already has a looper, it is returned. Otherwise, a new one is created, associated with the thread, and returned.

pub fn acquire(&self) -> AcquiredLooper[src]

Acquire looper to prevent its deletion until AcquiredLooper object is dropped.

pub fn handle(&self) -> LooperHandle[src]

Get native looper handle.

pub fn poll_all_blind(&self)[src]

Performs all pending callbacks until all data has been consumed.

Calls ALooper_pollAll(0, NULL, NULL, NULL). This method is unstable and may be removed in favor of better version.

Trait Implementations

impl Copy for LooperRef[src]

impl Clone for LooperRef[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for LooperRef[src]

Auto Trait Implementations

impl !Send for LooperRef

impl !Sync for LooperRef

Blanket Implementations

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

impl<T> From for T[src]

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.