pub struct ThreadLooper { /* private fields */ }Expand description
A thread-local ALooper. This contains a native ALooper * and promises that there is a
looper associated with the current thread.
Implementations§
Source§impl ThreadLooper
impl ThreadLooper
Sourcepub fn for_thread() -> Option<Self>
pub fn for_thread() -> Option<Self>
Returns the looper associated with the current thread, if any.
Sourcepub fn poll_once(&self) -> Result<Poll, LooperError>
pub fn poll_once(&self) -> Result<Poll, LooperError>
Polls the looper, blocking on processing an event.
Sourcepub fn poll_once_timeout(&self, timeout: Duration) -> Result<Poll, LooperError>
pub fn poll_once_timeout(&self, timeout: Duration) -> Result<Poll, LooperError>
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).
Sourcepub fn poll_all(&self) -> Result<Poll, LooperError>
pub fn poll_all(&self) -> Result<Poll, LooperError>
Repeatedly polls the looper, blocking on processing an event.
This function will never return Poll::Callback.
Sourcepub fn poll_all_timeout(&self, timeout: Duration) -> Result<Poll, LooperError>
pub fn poll_all_timeout(&self, timeout: Duration) -> Result<Poll, LooperError>
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).
Sourcepub fn as_foreign(&self) -> &ForeignLooper
pub fn as_foreign(&self) -> &ForeignLooper
Returns a reference to the ForeignLooper that is associated with the current thread.
pub fn into_foreign(self) -> ForeignLooper
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ThreadLooper
impl RefUnwindSafe for ThreadLooper
impl !Send for ThreadLooper
impl !Sync for ThreadLooper
impl Unpin for ThreadLooper
impl UnwindSafe for ThreadLooper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more