pub struct Array<T: ToValue + FromValue>(/* private fields */);
Expand description
Array<A>
wraps an OCaml 'a array
without converting it to Rust
Implementations§
Source§impl Array<Float>
impl Array<Float>
Sourcepub unsafe fn set_f64_unchecked(&mut self, i: usize, f: f64)
pub unsafe fn set_f64_unchecked(&mut self, i: usize, f: f64)
Sourcepub unsafe fn get_double_unchecked(&self, i: usize) -> f64
pub unsafe fn get_double_unchecked(&self, i: usize) -> f64
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
Source§impl<T: ToValue + FromValue> Array<T>
impl<T: ToValue + FromValue> Array<T>
Sourcepub fn is_f64(&self) -> bool
pub fn is_f64(&self) -> bool
Check if Array contains only doubles, if so get_f64
and set_f64
should be used
to access values
Sourcepub unsafe fn set(&mut self, rt: &Runtime, i: usize, v: &T) -> Result<(), Error>
pub unsafe fn set(&mut self, rt: &Runtime, i: usize, v: &T) -> Result<(), Error>
Set array index
Sourcepub unsafe fn set_unchecked(&mut self, rt: &Runtime, i: usize, v: &T)
pub unsafe fn set_unchecked(&mut self, rt: &Runtime, i: usize, v: &T)
Sourcepub unsafe fn get_unchecked(&self, i: usize) -> T
pub unsafe fn get_unchecked(&self, i: usize) -> T
Trait Implementations§
Source§impl<T: ToValue + FromValue> FromValue for Array<T>
impl<T: ToValue + FromValue> FromValue for Array<T>
Source§fn from_value(value: Value) -> Self
fn from_value(value: Value) -> Self
Convert from OCaml value
impl<T: Eq + ToValue + FromValue> Eq for Array<T>
impl<T: ToValue + FromValue> StructuralPartialEq for Array<T>
Auto Trait Implementations§
impl<T> Freeze for Array<T>
impl<T> !RefUnwindSafe for Array<T>
impl<T> !Send for Array<T>
impl<T> !Sync for Array<T>
impl<T> Unpin for Array<T>where
T: Unpin,
impl<T> !UnwindSafe for Array<T>
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