SuppressedDrop

Trait SuppressedDrop 

Source
pub trait SuppressedDrop: Sealed {
    type Inner;

    // Required methods
    fn new(inner: Self::Inner) -> Self;
    fn as_ref(&self) -> &Self::Inner;
    fn as_mut(&mut self) -> &mut Self::Inner;
    fn into_inner(self) -> Self::Inner;
}
Expand description

Sealed trait that marks a type with a suppressed Drop implementation.

Useful for constraining your storage items types by this bound to make sure they won’t run drop when stored.

Required Associated Types§

Source

type Inner

The wrapped whose drop function is ignored.

Required Methods§

Source

fn new(inner: Self::Inner) -> Self

Source

fn as_ref(&self) -> &Self::Inner

Source

fn as_mut(&mut self) -> &mut Self::Inner

Source

fn into_inner(self) -> Self::Inner

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SuppressedDrop for ()

Source§

type Inner = ()

Source§

fn new(inner: Self::Inner) -> Self

Source§

fn as_ref(&self) -> &Self::Inner

Source§

fn as_mut(&mut self) -> &mut Self::Inner

Source§

fn into_inner(self) -> Self::Inner

Implementors§