[][src]Struct ocaml::bigarray::Array1

#[repr(transparent)]pub struct Array1<T>(_, _);

OCaml Bigarray.Array1 type, , this introduces no additional overhead compared to a Value type

Implementations

impl<T: Copy + Kind> Array1<T>[src]

pub fn of_slice(data: &mut [T]) -> Array1<T>[src]

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.

pub fn from_slice(data: &[T]) -> Array1<T>[src]

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

pub fn create(n: Size) -> Array1<T>[src]

Create a new OCaml Bigarray.Array1 with the given type and size

pub fn len(self) -> Size[src]

Returns the number of items in self

pub fn is_empty(self) -> bool[src]

Returns true when self.len() == 0

pub fn data(&self) -> &[T][src]

Get underlying data as Rust slice

pub fn data_mut(&mut self) -> &mut [T][src]

Get underlying data as mutable Rust slice

Trait Implementations

impl<T: Clone> Clone for Array1<T>[src]

impl<T: Copy> Copy for Array1<T>[src]

impl<T: Copy + Kind> From<&'static [T]> for Array1<T>[src]

impl<T: Copy + Kind> From<Vec<T>> for Array1<T>[src]

impl<T> FromValue for Array1<T>[src]

impl<T: PartialEq> PartialEq<Array1<T>> for Array1<T>[src]

impl<T> StructuralPartialEq for Array1<T>[src]

impl<T> ToValue for Array1<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Array1<T> where
    T: RefUnwindSafe

impl<T> Send for Array1<T> where
    T: Send

impl<T> Sync for Array1<T> where
    T: Sync

impl<T> Unpin for Array1<T> where
    T: Unpin

impl<T> UnwindSafe for Array1<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.