[][src]Struct wgpu::UnsafeFeatures

pub struct UnsafeFeatures { /* fields omitted */ }

Marker type signalling if unsafe features are allowed to be enabled.

This doesn't enable any unsafe features, but must be set to allow if an unsafe features is enabled.

The safety contract of safe Rust is that it is impossible to cause Undefined Behavior (UB) from safe Rust. If a feature would allow UB to happen, it must preset an unsafe interface. Enabling unsafe features is therefore an inherently unsafe operation.

Implementations

impl UnsafeFeatures[src]

pub unsafe fn allow() -> UnsafeFeatures[src]

Allow unsafe features to be enabled. This is an unsafe function and by calling this function, you assert that even with these features on, it is impossible to cause UB from within safe Rust.

pub fn disallow() -> UnsafeFeatures[src]

Disallow unsafe features.

pub fn allowed(self) -> bool[src]

Does this marker allow unsafe features.

Trait Implementations

impl Clone for UnsafeFeatures[src]

impl Copy for UnsafeFeatures[src]

impl Debug for UnsafeFeatures[src]

impl Default for UnsafeFeatures[src]

impl<'de> Deserialize<'de> for UnsafeFeatures[src]

impl Eq for UnsafeFeatures[src]

impl Hash for UnsafeFeatures[src]

impl PartialEq<UnsafeFeatures> for UnsafeFeatures[src]

impl Serialize for UnsafeFeatures[src]

impl StructuralEq for UnsafeFeatures[src]

impl StructuralPartialEq for UnsafeFeatures[src]

Auto Trait Implementations

impl RefUnwindSafe for UnsafeFeatures

impl Send for UnsafeFeatures

impl Sync for UnsafeFeatures

impl Unpin for UnsafeFeatures

impl UnwindSafe for UnsafeFeatures

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.