Skip to main content

NoDrop

Trait NoDrop 

Source
pub trait NoDrop { }
Expand description

This trait marks types that don’t need dropping.

This trait is a best effort for modeling such a constraint. It is not implemented for all types that don’t need dropping.

Specifically &mut T types don’t implement NoDrop but definitely would if it were possible.

Every T where T: Copy and every [T] where T: NoDrop automatically implements NoDrop.

It is used as a bound for BumpBox’s into_ref and into_mut so you don’t accidentally omit a drop that does matter.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl NoDrop for CStr

Source§

impl NoDrop for OsStr

Available on crate feature std only.
Source§

impl NoDrop for Path

Available on crate feature std only.
Source§

impl NoDrop for str

Source§

impl<T: NoDrop> NoDrop for [T]

Implementors§

Source§

impl NoDrop for FixedBumpString<'_>

Source§

impl<A, S> NoDrop for BumpScope<'_, A, S>

Source§

impl<T: Copy> NoDrop for T

Source§

impl<T: NoDrop> NoDrop for FixedBumpVec<'_, T>

Source§

impl<T> NoDrop for BumpBox<'_, T>
where T: NoDrop,