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
sourceimpl<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> 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>where
T: Unpin,
U: Unpin,
impl<T, U> UnwindSafe for VecMappedInPlace<T, U>where
T: UnwindSafe + RefUnwindSafe,
U: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Cast for T
impl<T> Cast for T
sourcefn cast<U>(self, interner: U::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: U::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
Cast a value to type
U
using CastTo
.