pub struct ZeroSized<T>(_);
Expand description
A storage that can hold zero sized types
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());
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
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
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.
The type returned in the event of a conversion error.