Trait rfw::prelude::HasRawWindowHandle[]

pub unsafe trait HasRawWindowHandle {
    fn raw_window_handle(&self) -> RawWindowHandle;
}
Expand description

Window that wraps around a raw window handle.

Safety guarantees

Users can safely assume that non-null/0 fields are valid handles, and it is up to the implementer of this trait to ensure that condition is upheld. However, It is entirely valid behavior for fields within each platform-specific RawWindowHandle variant to be null or 0, and appropriate checking should be done before the handle is used.

Despite that qualification, implementers should still make a best-effort attempt to fill in all available fields. If an implementation doesn’t, and a downstream user needs the field, it should try to derive the field from other fields the implementer does provide via whatever methods the platform provides.

The exact handles returned by raw_window_handle must remain consistent between multiple calls to raw_window_handle, and must be valid for at least the lifetime of the HasRawWindowHandle implementer.

Required methods

Implementations on Foreign Types

Returns a raw_window_handle::RawWindowHandle for the Window

Platform-specific

  • Android: Only available after receiving the Resumed event and before Suspended. If you try to get the handle outside of that period, this function will panic!

Implementors