[][src]Struct jlrs::value::array::TypedArray

#[repr(transparent)]pub struct TypedArray<'frame, 'data, T>(_, _, _, _)
where
    T: Copy + ValidLayout
;

Exactly the same as Array, except it has an explicit element type T.

Implementations

impl<'frame, 'data, T: Copy + ValidLayout> TypedArray<'frame, 'data, T>[src]

pub fn dimensions(self) -> Dimensions[src]

Returns the array's dimensions.

pub fn element_type(self) -> Value<'frame, 'static>[src]

Returns the type of this array's elements.

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

Returns true if the elements of the array are stored inline.

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

Returns true if the elements of the array are stored inline and at least one of the field of the inlined type is a pointer.

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

Returns true if the elements of the array are stored as Values.

pub fn copy_inline_data(self) -> JlrsResult<CopiedArray<T>>[src]

Copy the data of an inline array to Rust. Returns JlrsError::NotInline if the data is not stored inline or JlrsError::WrongType if the type of the elements is incorrect.

pub fn inline_data<'borrow, 'fr, F>(
    self,
    frame: &'borrow F
) -> JlrsResult<ArrayData<'borrow, 'fr, T, F>> where
    F: Frame<'fr>, 
[src]

Immutably borrow inline array data, you can borrow data from multiple arrays at the same time. Returns JlrsError::NotInline if the data is not stored inline or JlrsError::WrongType if the type of the elements is incorrect.

pub fn inline_data_mut<'borrow, 'fr, F>(
    self,
    frame: &'borrow mut F
) -> JlrsResult<InlineArrayDataMut<'borrow, 'fr, T, F>> where
    F: Frame<'fr>, 
[src]

Mutably borrow inline array data, you can mutably borrow a single array at the same time. Returns JlrsError::NotInline if the data is not stored inline or JlrsError::WrongType if the type of the elements is incorrect.

pub unsafe fn unrestricted_inline_data_mut<'borrow, 'fr, F>(
    self,
    frame: &'borrow F
) -> JlrsResult<UnrestrictedInlineArrayDataMut<'borrow, 'fr, T, F>> where
    F: Frame<'fr>, 
[src]

Mutably borrow inline array data without the restriction that only a single array can be mutably borrowed. It's your responsibility to ensure you don't create multiple mutable references to the same array data.

Returns JlrsError::NotInline if the data is not stored inline or JlrsError::WrongType if the type of the elements is incorrect.

pub unsafe fn value_data<'borrow, 'fr, F>(
    self,
    frame: &'borrow F
) -> JlrsResult<ArrayData<'borrow, 'fr, Value<'frame, 'data>, F>> where
    F: Frame<'fr>, 
[src]

Immutably borrow the data of this value array, you can borrow data from multiple arrays at the same time. The values themselves can be mutable, but you can't replace an element with another value. Returns JlrsError::Inline if the data is stored inline.

Safety: no slot on the GC stack is required to access and use the values in this array, the GC is aware of the array's data. If the element is changed either from Rust or Julia, the original value is no longer protected from garbage collection. If you need to keep using this value you must protect it by calling Value::extend.

pub unsafe fn value_data_mut<'borrow, 'fr, F>(
    self,
    frame: &'borrow mut F
) -> JlrsResult<ValueArrayDataMut<'borrow, 'frame, 'data, 'fr, F>> where
    F: Frame<'fr>, 
[src]

Mutably borrow the data of this value array, you can mutably borrow a single array at the same time. Returns JlrsError::Inline if the data is stored inline.

Safety: no slot on the GC stack is required to access and use the values in this array, the GC is aware of the array's data. If the element is changed either from Rust or Julia, the original value is no longer protected from garbage collection. If you need to keep using this value you must protect it by calling Value::extend.

pub unsafe fn unrestricted_value_data_mut<'borrow, 'fr, F>(
    self,
    frame: &'borrow F
) -> JlrsResult<UnrestrictedValueArrayDataMut<'borrow, 'frame, 'data, 'fr, F>> where
    F: Frame<'fr>, 
[src]

Mutably borrow the data of this value array without the restriction that only a single array can be mutably borrowed. It's your responsibility to ensure you don't create multiple mutable references to the same array data. Returns JlrsError::Inline if the data is stored inline.

Safety: no slot on the GC stack is required to access and use the values in this array, the GC is aware of the array's data. If the element is changed either from Rust or Julia, the original value is no longer protected from garbage collection. If you need to keep using this value you must protect it by calling Value::extend.

pub fn as_value(self) -> Value<'frame, 'data>[src]

Convert self to a Value.

Trait Implementations

impl<'frame, 'data, T: Copy + ValidLayout> Cast<'frame, 'data> for TypedArray<'frame, 'data, T>[src]

type Output = Self

impl<'frame, 'data, T: Clone> Clone for TypedArray<'frame, 'data, T> where
    T: Copy + ValidLayout
[src]

impl<'frame, 'data, T: Copy> Copy for TypedArray<'frame, 'data, T> where
    T: Copy + ValidLayout
[src]

impl<'frame, 'data, T: Debug> Debug for TypedArray<'frame, 'data, T> where
    T: Copy + ValidLayout
[src]

impl<'frame, 'data, T: Copy + ValidLayout> Into<Array<'frame, 'data>> for TypedArray<'frame, 'data, T>[src]

impl<'frame, 'data, T: Copy + ValidLayout> Into<Value<'frame, 'data>> for TypedArray<'frame, 'data, T>[src]

impl<'frame, 'data, T: Copy + ValidLayout> JuliaTypecheck for TypedArray<'frame, 'data, T>[src]

impl<'frame, 'data, T: Copy + ValidLayout> ValidLayout for TypedArray<'frame, 'data, T>[src]

Auto Trait Implementations

impl<'frame, 'data, T> RefUnwindSafe for TypedArray<'frame, 'data, T> where
    T: RefUnwindSafe
[src]

impl<'frame, 'data, T> !Send for TypedArray<'frame, 'data, T>[src]

impl<'frame, 'data, T> !Sync for TypedArray<'frame, 'data, T>[src]

impl<'frame, 'data, T> Unpin for TypedArray<'frame, 'data, T> where
    T: Unpin
[src]

impl<'frame, 'data, T> UnwindSafe for TypedArray<'frame, 'data, T> where
    T: UnwindSafe
[src]

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.