referrerpolicy=no-referrer-when-downgrade

Trait SuppressedDrop

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§

type Inner

The wrapped whose drop function is ignored.

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

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§

§

impl SuppressedDrop for ()

§

type Inner = ()

§

fn new(inner: <() as SuppressedDrop>::Inner)

§

fn as_ref(&self) -> &<() as SuppressedDrop>::Inner

§

fn as_mut(&mut self) -> &mut <() as SuppressedDrop>::Inner

§

fn into_inner(self) -> <() as SuppressedDrop>::Inner

Implementors§

§

impl<T> SuppressedDrop for NoDrop<T>
where T: Default,

§

type Inner = T