// Note(Lokathor): This is the neat part!! unsafeimpl<T: ZeroableInOption> Zeroable for Option<T> {}
/// Trait for types which are [Zeroable](Zeroable) when wrapped in /// [Option](core::option::Option). /// /// ## Safety /// /// * `Option<YourType>` must uphold the same invariants as /// [Zeroable](Zeroable). pubunsafetrait ZeroableInOption: Sized {}
unsafeimpl ZeroableInOption for NonZeroI8 {} unsafeimpl ZeroableInOption for NonZeroI16 {} unsafeimpl ZeroableInOption for NonZeroI32 {} unsafeimpl ZeroableInOption for NonZeroI64 {} unsafeimpl ZeroableInOption for NonZeroI128 {} unsafeimpl ZeroableInOption for NonZeroIsize {} unsafeimpl ZeroableInOption for NonZeroU8 {} unsafeimpl ZeroableInOption for NonZeroU16 {} unsafeimpl ZeroableInOption for NonZeroU32 {} unsafeimpl ZeroableInOption for NonZeroU64 {} unsafeimpl ZeroableInOption for NonZeroU128 {} unsafeimpl ZeroableInOption for NonZeroUsize {}
// Note: this does not create NULL vtable because we get `None` anyway. unsafeimpl<T: ?Sized> ZeroableInOption for NonNull<T> {} unsafeimpl<T: ?Sized> ZeroableInOption for &'_ T {} unsafeimpl<T: ?Sized> ZeroableInOption for &'_ mut T {}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.