Skip to main content

AltComplexData

Trait AltComplexData 

Source
pub trait AltComplexData: AltrepLen {
    // Required method
    fn elt(&self, i: usize) -> Rcomplex;

    // Provided methods
    fn as_slice(&self) -> Option<&[Rcomplex]> { ... }
    fn get_region(
        &self,
        start: usize,
        len: usize,
        buf: &mut [Rcomplex],
    ) -> usize { ... }
}
Expand description

Trait for types that can back an ALTCOMPLEX vector.

Required Methods§

Source

fn elt(&self, i: usize) -> Rcomplex

Get the complex element at index i.

Provided Methods§

Source

fn as_slice(&self) -> Option<&[Rcomplex]>

Optional: return a slice if data is contiguous.

Source

fn get_region(&self, start: usize, len: usize, buf: &mut [Rcomplex]) -> usize

Optional: bulk read into buffer (clamped to available data).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AltComplexData for Box<[Rcomplex]>

Source§

fn elt(&self, i: usize) -> Rcomplex

Source§

fn as_slice(&self) -> Option<&[Rcomplex]>

Source§

fn get_region(&self, start: usize, len: usize, buf: &mut [Rcomplex]) -> usize

Source§

impl AltComplexData for Cow<'static, [Rcomplex]>

Source§

fn elt(&self, i: usize) -> Rcomplex

Source§

fn as_slice(&self) -> Option<&[Rcomplex]>

Source§

fn get_region(&self, start: usize, len: usize, buf: &mut [Rcomplex]) -> usize

Source§

impl AltComplexData for Vec<Rcomplex>

Source§

fn elt(&self, i: usize) -> Rcomplex

Source§

fn as_slice(&self) -> Option<&[Rcomplex]>

Source§

fn get_region(&self, start: usize, len: usize, buf: &mut [Rcomplex]) -> usize

Source§

impl<const N: usize> AltComplexData for [Rcomplex; N]

Source§

fn elt(&self, i: usize) -> Rcomplex

Source§

fn as_slice(&self) -> Option<&[Rcomplex]>

Source§

fn get_region(&self, start: usize, len: usize, buf: &mut [Rcomplex]) -> usize

Implementors§