Trait CppDeletable

Source
pub trait CppDeletable: Sized {
    // Required method
    unsafe fn delete(&self);
}
Expand description

Objects that can be deleted using C++’s delete operator.

This trait is automatically implemented for class types by ritual.

Required Methods§

Source

unsafe fn delete(&self)

Calls C++’s delete x on self.

§Safety

The caller must make sure self contains a valid pointer. This function may invoke arbitrary foreign code, so no safety guarantees can be made. Note that deleting an object multiple times is undefined behavior.

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.

Implementors§