Struct raw_window_handle::ActiveHandle
source · pub struct ActiveHandle<'a>(/* private fields */);
Expand description
Represents a live window handle.
This is carried around by the Active
type, and is used to ensure that the application doesn’t
enter the suspended state while there are still live window handles. See documentation on the
Active
type for more information.
On non-Android platforms, this is a ZST. On Android, this is a reference counted handle that keeps the application active while it is alive.
Implementations§
source§impl ActiveHandle<'_>
impl ActiveHandle<'_>
source§impl ActiveHandle<'_>
impl ActiveHandle<'_>
sourcepub unsafe fn new_unchecked() -> Self
pub unsafe fn new_unchecked() -> Self
Create a new freestanding active handle.
This function acts as an “escape hatch” to allow the user to create a live window handle
without having to go through the Active
type. This is useful if the user knows that the
application is active, and wants to create a live window handle without having to go through
the Active
type.
Safety
The application must actually be active.
Example
use raw_window_handle::ActiveHandle;
// Create a freestanding active handle.
// SAFETY: The application must actually be active.
let handle = unsafe { ActiveHandle::new_unchecked() };
Trait Implementations§
source§impl<'a> Clone for ActiveHandle<'a>
impl<'a> Clone for ActiveHandle<'a>
source§fn clone(&self) -> ActiveHandle<'a>
fn clone(&self) -> ActiveHandle<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more