Struct cl_generic_vec::raw::ZeroSized[][src]

pub struct ZeroSized<T>(_);
Expand description

A storage that can hold zero sized types

Implementations

Create a new zero-sized allocator, can only be used with zero-sized types

let _ = ZeroSized::<[i32; 0]>::NEW;
let _ = ZeroSized::<u8>::NEW;

Try to create a new zero-sized allocator, will be None if the type is not zero sized

assert!(ZeroSized::<[i32; 0]>::TRY_NEW.is_some());
assert!(ZeroSized::<u8>::TRY_NEW.is_none());

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Is the pointer from as_ptr guaranteed to be aligned to T Read more

Returns a pointer to the first element

Returns a mutable pointer to the first element

Reserves space for at least new_capacity elements Read more

Tries to reserve space for at least new_capacity elements Read more

The number of elements that it is valid to write to this Storage Read more

Creates a new storage with at least the given storage capacity

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.