Skip to main content

View

Struct View 

Source
pub struct View<'a, T, Layout, const L: usize> { /* private fields */ }
Expand description

Immutable typed view of a DSP slice.

Layout describes how the flat storage should be interpreted. The view never allocates or physically transposes memory.

Implementations§

Source§

impl<'a, T, Layout, const L: usize> View<'a, T, Layout, L>

Source

pub fn flat(self) -> &'a [T]

Flat underlying storage.

Source

pub const fn frames(self) -> usize

Number of frames in the view.

Source

pub fn as_layout<Other>(self) -> View<'a, T, Other, L>

Reinterpret the same backing storage under another layout marker.

Source§

impl<'a, T, const L: usize> View<'a, T, FrameMajor, L>

Source

pub fn from_frames(frames: &'a [[T; L]]) -> Self

Borrow a conventional frame-major view.

Source

pub fn as_frames(self) -> &'a [[T; L]]

Borrow the view as exact frames.

Source

pub fn frame(self, i: usize) -> &'a [T; L]

Borrow one frame.

Source§

impl<'a, T, const L: usize> View<'a, T, LaneMajor, L>

Source

pub fn from_flat(flat: &'a [T], frames: usize) -> Self

Borrow a lane-major flat view.

frames must satisfy flat.len() == frames * L.

Source

pub fn lane(self, i: usize) -> &'a [T]

Borrow one contiguous lane slice.

Trait Implementations§

Source§

impl<'a, T: Clone, Layout: Clone, const L: usize> Clone for View<'a, T, Layout, L>

Source§

fn clone(&self) -> View<'a, T, Layout, L>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, T: Copy, Layout: Copy, const L: usize> Copy for View<'a, T, Layout, L>

Source§

impl<'a, T: Debug, Layout: Debug, const L: usize> Debug for View<'a, T, Layout, L>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, 'b, X: Copy, Y, C0, C1, S0, S1> SplitViewProcess<View<'a, X, LaneMajor, 2>, ViewMut<'b, Y, LaneMajor, 2>, (S0, S1)> for ByLane<(C0, C1)>
where C0: SplitProcess<X, Y, S0>, C1: SplitProcess<X, Y, S1>,

Source§

fn process_view( &self, state: &mut (S0, S1), x: View<'a, X, LaneMajor, 2>, y: ViewMut<'b, Y, LaneMajor, 2>, )

Process one typed input view into one typed output view.
Source§

impl<'a, 'b, X: Copy, Y, C, S, const N: usize> SplitViewProcess<View<'a, X, LaneMajor, N>, ViewMut<'b, Y, LaneMajor, N>, [S; N]> for ByLane<[C; N]>
where C: SplitProcess<X, Y, S>,

Source§

fn process_view( &self, state: &mut [S; N], x: View<'a, X, LaneMajor, N>, y: ViewMut<'b, Y, LaneMajor, N>, )

Process one typed input view into one typed output view.
Source§

impl<'a, 'b, X: Copy, Y, C, S, const N: usize> SplitViewProcess<View<'a, X, LaneMajor, N>, ViewMut<'b, Y, LaneMajor, N>, [S; N]> for Lanes<C>
where C: SplitProcess<X, Y, S>,

Source§

fn process_view( &self, state: &mut [S; N], x: View<'a, X, LaneMajor, N>, y: ViewMut<'b, Y, LaneMajor, N>, )

Process one typed input view into one typed output view.

Auto Trait Implementations§

§

impl<'a, T, Layout, const L: usize> Freeze for View<'a, T, Layout, L>

§

impl<'a, T, Layout, const L: usize> RefUnwindSafe for View<'a, T, Layout, L>
where Layout: RefUnwindSafe, T: RefUnwindSafe,

§

impl<'a, T, Layout, const L: usize> Send for View<'a, T, Layout, L>
where Layout: Send, T: Sync,

§

impl<'a, T, Layout, const L: usize> Sync for View<'a, T, Layout, L>
where Layout: Sync, T: Sync,

§

impl<'a, T, Layout, const L: usize> Unpin for View<'a, T, Layout, L>
where Layout: Unpin,

§

impl<'a, T, Layout, const L: usize> UnsafeUnpin for View<'a, T, Layout, L>

§

impl<'a, T, Layout, const L: usize> UnwindSafe for View<'a, T, Layout, L>
where Layout: UnwindSafe, T: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'a, 'b, X, Y, S, T, const L: usize> SplitViewProcess<View<'a, X, FrameMajor, L>, ViewMut<'b, Y, FrameMajor, L>, S> for T
where X: Copy, T: SplitProcess<X, Y, S>, S: ?Sized,

Source§

fn process_view( &self, state: &mut S, x: View<'a, X, FrameMajor, L>, y: ViewMut<'b, Y, FrameMajor, L>, )

Process one typed input view into one typed output view.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.