#[repr(C)]pub struct ArrayBox<T> {
pub data: *mut T,
pub length: usize,
pub capacity: usize,
pub owned: bool,
}
Fields
data: *mut T
length: usize
capacity: usize
owned: bool
Implementations
sourceimpl<T> ArrayBox<T>
impl<T> ArrayBox<T>
pub fn new() -> Self
pub fn from_vector(vector: Vec<T>) -> Self
sourcepub fn from_array(array_buffer: &[T]) -> Selfwhere
T: Clone,
pub fn from_array(array_buffer: &[T]) -> Selfwhere
T: Clone,
I create a copy of a given array
sourcepub fn from_data(data: *mut T, length: usize) -> Self
pub fn from_data(data: *mut T, length: usize) -> Self
Create an array assuming that I don’t own the data
sourcepub fn set_vector(&mut self, vector: Vec<T>)
pub fn set_vector(&mut self, vector: Vec<T>)
Mutate me to hold a given vector
sourcepub fn set_array(&mut self, array_buffer: &[T])where
T: Clone,
pub fn set_array(&mut self, array_buffer: &[T])where
T: Clone,
Mutate me to hold a given vector
pub fn to_slice(&self) -> &mut [T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn copy_into(&self, another_array: &mut ArrayBox<T>)
pub fn to_vector(self) -> Vec<T>where
T: Clone,
pub fn at_put(&mut self, index: usize, object: T)
pub fn at(&self, index: usize) -> Twhere
T: Clone,
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for ArrayBox<T>where
T: RefUnwindSafe,
impl<T> !Send for ArrayBox<T>
impl<T> !Sync for ArrayBox<T>
impl<T> Unpin for ArrayBox<T>
impl<T> UnwindSafe for ArrayBox<T>where
T: RefUnwindSafe,
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