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)
Auto Trait Implementations§
impl<T, U> Freeze for VecMappedInPlace<T, U>
impl<T, U> RefUnwindSafe for VecMappedInPlace<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> !Send for VecMappedInPlace<T, U>
impl<T, U> !Sync for VecMappedInPlace<T, U>
impl<T, U> Unpin for VecMappedInPlace<T, U>
impl<T, U> UnwindSafe for VecMappedInPlace<T, U>
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