Struct zerovec::zerovec::EyepatchHackVector
source · struct EyepatchHackVector<U> {
buf: *mut [U],
capacity: usize,
}
Fields§
§buf: *mut [U]
Pointer to data
This pointer is always valid, the reason it is represented as a raw pointer
is that it may logically represent an &[T::ULE]
or the ptr,len of a Vec<T::ULE>
capacity: usize
Borrowed if zero. Capacity of buffer above if not
Implementations§
source§impl<U> EyepatchHackVector<U>
impl<U> EyepatchHackVector<U>
unsafe fn as_arbitrary_slice<'a>(&self) -> &'a [U]
const fn as_slice<'a>(&'a self) -> &'a [U]
sourceunsafe fn get_vec(&self) -> Vec<U>
unsafe fn get_vec(&self) -> Vec<U>
Return this type as a vector
Data MUST be known to be owned beforehand
Because this borrows self, this is effectively creating two owners to the same
data, make sure that self
is cleaned up after this
(this does not simply take self
since then it wouldn’t be usable from the Drop impl)
Trait Implementations§
Auto Trait Implementations§
impl<U> RefUnwindSafe for EyepatchHackVector<U>where U: RefUnwindSafe,
impl<U> !Send for EyepatchHackVector<U>
impl<U> !Sync for EyepatchHackVector<U>
impl<U> Unpin for EyepatchHackVector<U>
impl<U> UnwindSafe for EyepatchHackVector<U>where U: RefUnwindSafe,
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