[−][src]Struct ndk::looper::ThreadLooper
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
Auto Trait Implementations
impl RefUnwindSafe for ThreadLooper
impl !Send for ThreadLooper
impl !Sync for ThreadLooper
impl Unpin for ThreadLooper
impl UnwindSafe for ThreadLooper
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,