[][src]Struct ocaml::Array

#[repr(transparent)]pub struct Array<T: ToValue + FromValue>(_, _);

Array<A> wraps an OCaml 'a array without converting it to Rust

Implementations

impl<'a> Array<f64>[src]

pub fn set_double(&mut self, i: usize, f: f64) -> Result<(), Error>[src]

Set value to double array

pub unsafe fn set_double_unchecked(&mut self, i: usize, f: f64)[src]

Set value to double array without bounds checking

Safety

This function performs no bounds checking

pub fn get_double(self, i: usize) -> Result<f64, Error>[src]

Get a value from a double array

pub unsafe fn get_double_unchecked(self, i: usize) -> f64[src]

Get a value from a double array without checking if the array is actually a double array

Safety

This function does not perform bounds checking

impl<T: ToValue + FromValue> Array<T>[src]

pub fn alloc(n: usize) -> Array<T>[src]

Allocate a new Array

pub fn is_double_array(&self) -> bool[src]

Check if Array contains only doubles, if so get_double and set_double should be used to access values

pub fn len(&self) -> usize[src]

Array length

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

Returns true when the array is empty

pub fn set(&mut self, i: usize, v: T) -> Result<(), Error>[src]

Set array index

pub unsafe fn set_unchecked(&mut self, i: usize, v: T)[src]

Set array index without bounds checking

Safety

This function does not perform bounds checking

pub fn get(&self, i: usize) -> Result<T, Error>[src]

Get array index

pub unsafe fn get_unchecked(&self, i: usize) -> T[src]

Get array index without bounds checking

Safety

This function does not perform bounds checking

pub fn as_slice(&self) -> &[Value][src]

Array as slice

pub fn as_mut_slice(&mut self) -> &mut [Value][src]

Array as mutable slice

pub fn to_vec(&self) -> Vec<T>[src]

Array as Vec

Trait Implementations

impl<T: Clone + ToValue + FromValue> Clone for Array<T>[src]

impl<T: Copy + ToValue + FromValue> Copy for Array<T>[src]

impl<T: ToValue + FromValue> FromValue for Array<T>[src]

impl<T: PartialEq + ToValue + FromValue> PartialEq<Array<T>> for Array<T>[src]

impl<T: ToValue + FromValue> StructuralPartialEq for Array<T>[src]

impl<T: ToValue + FromValue> ToValue for Array<T>[src]

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Array<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.