Struct raw_window_handle::TrustedWindowHandle [−][src]
pub struct TrustedWindowHandle { /* fields omitted */ }
Expand description
This wraps a RawWindowHandle
to give it a HasRawWindowHandle
impl.
The HasRawWindowHandle
trait must be an unsafe
trait because other
unsafe code is going to rely on it to provide accurate window handle info.
Since RawWindowHandle
is an enum and enum fields are public, anyone could
make any random RawWindowHandle
value in safe code.
The solution is that you assert that you’re trusting a particular handle value by (unsafely) placing it within this wrapper struct.
Implementations
Assert that the RawWindowHandle
value can be trusted.
Safety
If the value violates any of the safety outlines given in the
HasRawWindowHandle
trait this can lead to UB.
Read from a HasRawWindowHandle
into being a trusted value.