Trait CopyOnlyType

Source
pub trait CopyOnlyType: Clone + Sized {
    const COPY: CSTL_CopyType = _;

    // Provided methods
    unsafe extern "C" fn raw_move(
        first: NonNull<Self>,
        last: NonNull<Self>,
        dest: NonNull<Self>,
    ) { ... }
    unsafe extern "C" fn raw_copy(
        first: NonNull<Self>,
        last: NonNull<Self>,
        dest: NonNull<Self>,
    ) { ... }
    unsafe extern "C" fn raw_fill(
        first: NonNull<Self>,
        last: NonNull<Self>,
        value: NonNull<Self>,
    ) { ... }
}
Expand description

Trait for types that can be copied and moved with C++ semantics.

Unlike CopyMoveType it is for types that are Clone but aren’t Default.

C++ move semantics imply that a copy is a valid kind of move, as it leaves the destination equal to the source as it was before, and leaves the source initialized.

Provides a CSTL_CopyType table.

Provided Associated Constants§

Source

const COPY: CSTL_CopyType = _

CSTL copyable type table.

Provided Methods§

Source

unsafe extern "C" fn raw_move( first: NonNull<Self>, last: NonNull<Self>, dest: NonNull<Self>, )

Source

unsafe extern "C" fn raw_copy( first: NonNull<Self>, last: NonNull<Self>, dest: NonNull<Self>, )

Source

unsafe extern "C" fn raw_fill( first: NonNull<Self>, last: NonNull<Self>, value: NonNull<Self>, )

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§