|
35 | 35 | //! marshalled between the Java thread that owns the `Activity` and the native
|
36 | 36 | //! thread that runs the `android_main()` code.
|
37 | 37 | //!
|
| 38 | +//! # Cheaply Clonable [`AndroidApp`] |
| 39 | +//! |
| 40 | +//! [`AndroidApp`] is intended to be something that can be cheaply passed around |
| 41 | +//! by referenced within an application. It is reference counted and can be |
| 42 | +//! cheaply cloned. |
| 43 | +//! |
| 44 | +//! # `Send` and `Sync` [`AndroidApp`] |
| 45 | +//! |
| 46 | +//! Although an [`AndroidApp`] implements `Send` and `Sync` you do need to take |
| 47 | +//! into consideration that some APIs, such as [`AndroidApp::poll_events()`] are |
| 48 | +//! explicitly documented to only be usable from your `android_main()` thread. |
| 49 | +//! |
38 | 50 | //! # Main Thread Initialization
|
39 | 51 | //!
|
40 | 52 | //! Before `android_main()` is called, the following application state
|
@@ -489,6 +501,18 @@ bitflags! {
|
489 | 501 | /// marshalled between the Java thread that owns the `Activity` and the native
|
490 | 502 | /// thread that runs the `android_main()` code.
|
491 | 503 | ///
|
| 504 | +/// # Cheaply Clonable [`AndroidApp`] |
| 505 | +/// |
| 506 | +/// [`AndroidApp`] is intended to be something that can be cheaply passed around |
| 507 | +/// by referenced within an application. It is reference counted and can be |
| 508 | +/// cheaply cloned. |
| 509 | +/// |
| 510 | +/// # `Send` and `Sync` [`AndroidApp`] |
| 511 | +/// |
| 512 | +/// Although an [`AndroidApp`] implements `Send` and `Sync` you do need to take |
| 513 | +/// into consideration that some APIs, such as [`AndroidApp::poll_events()`] are |
| 514 | +/// explicitly documented to only be usable from your `android_main()` thread. |
| 515 | +/// |
492 | 516 | #[derive(Debug, Clone)]
|
493 | 517 | pub struct AndroidApp {
|
494 | 518 | pub(crate) inner: Arc<RwLock<AndroidAppInner>>,
|
|
0 commit comments