[−][src]Struct android_looper::LooperRef
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(&self) -> 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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,