pub struct SharedVecPart<T> { /* private fields */ }Expand description
A slice-like view into a segment of a SharedVecMut allocation.
It can be read as a slice or mutated in place while the underlying allocation is still owned
by the original SharedVecMut.
Dropping a SharedVecPart leaks the underlying allocation.
When the panic-on-drop feature is enabled, dropping it will panic:
ⓘ
let mut values = manual_share::SharedVecMut::from_vec(vec![1, 2, 3, 4]);
let mut part = values.split_off(2).unwrap();
// forget SharedVecMut to make sure the panic is not caused by dropping it first.
std::mem::forget(values);
// panic here due to dropping ShareVecPartImplementations§
Trait Implementations§
Auto Trait Implementations§
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