#[repr(transparent)]pub struct Array1<T>(_, _);
Expand description
OCaml Bigarray.Array1 type, this introduces no
additional overhead compared to a Value
type
Implementations
sourceimpl<T: Copy + Kind> Array1<T>
impl<T: Copy + Kind> Array1<T>
sourcepub unsafe fn of_slice(data: &mut [T]) -> Array1<T>
pub unsafe fn of_slice(data: &mut [T]) -> Array1<T>
Array1::of_slice is used to convert from a slice to OCaml Bigarray,
the data
parameter must outlive the resulting bigarray or there is
no guarantee the data will be valid. Use Array1::from_slice
to clone the
contents of a slice.
sourcepub unsafe fn from_slice(data: impl AsRef<[T]>) -> Array1<T>
pub unsafe fn from_slice(data: impl AsRef<[T]>) -> Array1<T>
Convert from a slice to OCaml Bigarray, copying the array. This is the implemtation
used by Array1::from
for slices to avoid any potential lifetime issues
sourcepub unsafe fn create(n: Size) -> Array1<T>
pub unsafe fn create(n: Size) -> Array1<T>
Create a new OCaml Bigarray.Array1
with the given type and size
Trait Implementations
sourceimpl<T> FromValue for Array1<T>
impl<T> FromValue for Array1<T>
sourcefn from_value(value: Value) -> Array1<T>
fn from_value(value: Value) -> Array1<T>
Convert from OCaml value
sourceimpl<T: PartialEq> PartialEq<Array1<T>> for Array1<T>
impl<T: PartialEq> PartialEq<Array1<T>> for Array1<T>
impl<T: Eq> Eq for Array1<T>
impl<T> StructuralEq for Array1<T>
impl<T> StructuralPartialEq for Array1<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Array1<T>where
T: RefUnwindSafe,
impl<T> !Send for Array1<T>
impl<T> !Sync for Array1<T>
impl<T> Unpin for Array1<T>where
T: Unpin,
impl<T> UnwindSafe for Array1<T>where
T: 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