Crate android_looper [−] [src]
From android docs:
Class used to run a message loop for a thread. Threads by default do not have a message loop associated with them; to create one, call prepare() in the thread that is to run the loop, and then loop() to have it process messages until the loop is stopped.
This library is a minimal safe wrapper for what otherwise be unsafe ffi bindings. There are few conventions used here that are good to know to make the best use of it.
While this library may provide the
RAII wrappers (see bellow), it will not keep
track of wrapper dependencies. Doing it at this level would require
Rc machinery that
may cause several problems: force users to use
Arc, complicate implementation,
no longer be zero-cost.
Instead, the users are encouraged to build wrappers around these different type kinds (listed bellow) that manage resources as needed for each use case.
This is RAII type
that wraps a low-level resource, provides methods to manipulate it and also destroys it when
it goes out of scope. It may also have convenience methods
from_handle as constructor and method
forget to get back the handle and disable the
Used for tracking intermediate glue information, usually replaces or wraps cumbersome
types or enums.
Wraps a low level handle(s) and provides methods to manipulate it/them. Used in situations where the handle lifetime is controlled by another object or it is some kind of global singleton. In such cases the method calls themselves may return errors when called on expired or invalid handle.
Looper Error and Result.
Reference to a looper.
Option for for