NdArray

Trait NdArray 

Source
pub trait NdArray<'borrow, T>: Sealed {
    // Required methods
    fn array_view<'frame: 'borrow, F>(
        self,
        frame: &'borrow F,
    ) -> JlrsResult<ArrayView<'borrow, T, Dim<IxDynImpl>>>
       where F: Frame<'frame>,
             T: ValidLayout + Copy;
    fn array_view_mut<'frame: 'borrow, F>(
        self,
        frame: &'borrow mut F,
    ) -> JlrsResult<ArrayViewMut<'borrow, T, Dim<IxDynImpl>>>
       where F: Frame<'frame>,
             T: ValidLayout + Copy;
}
Expand description

Trait to borrow Julia arrays with inline data as ndarray’s ArrayView and ArrayViewMut.

Required Methods§

Source

fn array_view<'frame: 'borrow, F>( self, frame: &'borrow F, ) -> JlrsResult<ArrayView<'borrow, T, Dim<IxDynImpl>>>
where F: Frame<'frame>, T: ValidLayout + Copy,

Borrow the data in the array as an ArrayView. Returns an error if the wrong type is provided or the data is not stored inline.

Source

fn array_view_mut<'frame: 'borrow, F>( self, frame: &'borrow mut F, ) -> JlrsResult<ArrayViewMut<'borrow, T, Dim<IxDynImpl>>>
where F: Frame<'frame>, T: ValidLayout + Copy,

Mutably borrow the data in the array as an ArrayViewMut. Returns an error if the wrong type is provided or the data is not stored inline.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'frame: 'borrow, 'data: 'borrow, 'borrow, T: ValidLayout + Copy> NdArray<'borrow, T> for Array<'frame, 'data>

Source§

fn array_view<'fr: 'borrow, F>( self, frame: &'borrow F, ) -> JlrsResult<ArrayView<'borrow, T, Dim<IxDynImpl>>>
where F: Frame<'fr>, T: ValidLayout + Copy,

Source§

fn array_view_mut<'fr: 'borrow, F>( self, frame: &'borrow mut F, ) -> JlrsResult<ArrayViewMut<'borrow, T, Dim<IxDynImpl>>>
where F: Frame<'fr>, T: ValidLayout + Copy,

Source§

impl<'frame: 'borrow, 'data: 'borrow, 'borrow, T: ValidLayout + Copy> NdArray<'borrow, T> for TypedArray<'frame, 'data, T>

Source§

fn array_view<'fr: 'borrow, F>( self, frame: &'borrow F, ) -> JlrsResult<ArrayView<'borrow, T, Dim<IxDynImpl>>>
where F: Frame<'fr>, T: ValidLayout,

Source§

fn array_view_mut<'fr: 'borrow, F>( self, frame: &'borrow mut F, ) -> JlrsResult<ArrayViewMut<'borrow, T, Dim<IxDynImpl>>>
where F: Frame<'fr>, T: ValidLayout,

Implementors§