Function wgpu_core::id::as_option_slice
source · pub fn as_option_slice<T: Marker>(ids: &[Id<T>]) -> &[Option<Id<T>>]
Expand description
Coerce a slice of identifiers into a slice of optional raw identifiers.
There’s two reasons why we know this is correct:
Option<T>
is guaranteed to be niche-filled to 0’s.- The
T
inOption<T>
can inhabit any representation except 0’s, since its underlying representation isNonZero*
.