#[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§
Source§impl<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]
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> Freeze for ArrayBox<T>
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§
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