[−][src]Struct ocaml::bigarray::Array1
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]
fn from(x: &'static [T]) -> Array1<T>
[src]
impl<T: Copy + Kind> From<Vec<T>> for Array1<T>
[src]
impl<T> FromValue for Array1<T>
[src]
fn from_value(value: Value) -> 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,
T: RefUnwindSafe,
impl<T> Send for Array1<T> where
T: Send,
T: Send,
impl<T> Sync for Array1<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Array1<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Array1<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,