Struct android_looper::LooperRef
[−]
[src]
pub struct LooperRef { // some 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
fn from_handle(handle: LooperHandle) -> LooperRef
Create LooperRef
from native handle.
fn prepare(opts: LooperPrepareOpts) -> Result<LooperRef>
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.
fn acquire(&self) -> AcquiredLooper
Acquire looper to prevent its deletion until AcquiredLooper
object is dropped.
fn handle(&self) -> LooperHandle
Get native looper handle.
fn poll_all_blind(&self)
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.