Struct android_looper::LooperRef [] [src]

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]

Create LooperRef from native handle.

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.

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

Get native looper handle.

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for LooperRef
[src]

Formats the value using the given formatter.