#[non_exhaustive]pub enum VecConversionError {
AlignMismatch {
expected: usize,
allocated: usize,
},
SlackCapacity {
element_size: usize,
allocated: usize,
},
ZeroSizedElements,
}Expand description
Error when converting an Allocation to a Vec.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AlignMismatch
Indicates an alignment mismatch of the requested element type and the allocation.
Fields
SlackCapacity
Indicates that there is some slack capacity when trying to fit a whole multiple of elements into the allocated memory to determine the vec’s capacity.
Fields
ZeroSizedElements
Tried to convert to a Vec of ZSTs. This is currently not supported due to ambiguity of the requested capacity. Even if the allocation is zero-sized, we can fit an arbitrary amount of elements as capacity.
If you need this conversion to succeed, open an issue.
Trait Implementations§
Source§impl Clone for VecConversionError
impl Clone for VecConversionError
Source§fn clone(&self) -> VecConversionError
fn clone(&self) -> VecConversionError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VecConversionError
impl RefUnwindSafe for VecConversionError
impl Send for VecConversionError
impl Sync for VecConversionError
impl Unpin for VecConversionError
impl UnwindSafe for VecConversionError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more