Struct chalk_ir::fold::in_place::VecMappedInPlace
source · struct VecMappedInPlace<T, U> {
ptr: *mut T,
len: usize,
cap: usize,
map_in_progress: usize,
_elem_tys: PhantomData<(T, U)>,
}
Expand description
Takes ownership of a Vec
that is being mapped in place, cleaning up if the map fails.
Fields§
§ptr: *mut T
§len: usize
§cap: usize
§map_in_progress: usize
§_elem_tys: PhantomData<(T, U)>
Implementations§
Trait Implementations§
source§impl<T, U> Drop for VecMappedInPlace<T, U>
impl<T, U> Drop for VecMappedInPlace<T, U>
VecMappedInPlace
drops everything but the element that was passed to map
when it panicked or
returned an error. Everything before that index in the vector has type U
(it has been mapped)
and everything after it has type T
(it has not been mapped).
mapped
| not yet mapped
|----| |-----|
[UUUU UxTT TTTT]
^
`map_in_progress` (not dropped)