Split

Struct Split 

Source
pub struct Split<C, S> {
    pub config: C,
    pub state: S,
}
Expand description

A stateful processor with split state

Fields§

§config: C

Processor configuration

§state: S

Processor state

Implementations§

Source§

impl<C, S> Split<C, S>

Source

pub const fn new(config: C, state: S) -> Self

Create a new Split

Source

pub const fn assert_process<X: Copy, Y>(&self)
where Self: Process<X, Y>,

Statically assert that this implements Process<X, Y>

Source

pub fn as_mut(&mut self) -> Split<&C, &mut S>

Obtain a borrowing Split

Stateful Process is implemented on the borrowing Split

Source§

impl<C> Split<Unsplit<C>, ()>

Source

pub fn stateless(config: C) -> Self

Create a stateless processor

Source§

impl<S> Split<(), Unsplit<S>>

Source

pub fn stateful(state: S) -> Self

Create a state-only processor

Source§

impl<C, S> Split<C, S>

Source

pub fn minor<U>(self) -> Split<Minor<C, U>, S>

Convert to a configuration-minor split

Source

pub fn major<U>(self) -> Split<Major<C, U>, S>

Convert to intermediate buffered processor-major

Source

pub fn parallel(self) -> Split<Parallel<C>, S>

Convert to parallel (MIMO)

Source

pub fn repeat<const N: usize>(self) -> Split<[C; N], [S; N]>
where C: Clone, S: Clone,

Repeat by cloning configuration and current (!) state

Source

pub fn channels<const N: usize>(self) -> Split<Channels<C>, [S; N]>
where S: Clone,

Apply to multiple states by cloning the current (!) state

Source

pub fn transpose(self) -> Split<Transpose<C>, S>

Convert to parallel transpose operation on blocks/inplace of [[x]; N] instead of [[x; N]]

Source§

impl<C, S, U> Split<Minor<C, U>, S>

Source

pub fn inter(self) -> Split<C, S>

Strip minor

Source§

impl<C, S> Split<Parallel<C>, S>

Source

pub fn inter(self) -> Split<C, S>

Convert to serial

Source§

impl<C, S> Split<Transpose<C>, S>

Source

pub fn inter(self) -> Split<C, S>

Convert to non-transposing

Source§

impl<C, S, B> Split<Major<C, B>, S>

Source

pub fn inter(self) -> Split<C, S>

Remove major intermediate buffering

Source§

impl<C0, C1, S0, S1> Split<(C0, C1), (S0, S1)>

Source

pub fn zip(self) -> (Split<C0, S0>, Split<C1, S1>)

Zip up a split

Source§

impl<C, S, const N: usize> Split<[C; N], [S; N]>

Source

pub fn zip(self) -> [Split<C, S>; N]

Zip up a split

Trait Implementations§

Source§

impl<C0, C1, S0, S1> Add<Split<C1, S1>> for Split<C0, S0>

Unzip two splits into one parallel

Source§

type Output = Split<Parallel<(C0, C1)>, (S0, S1)>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Split<C1, S1>) -> Self::Output

Performs the + operation. Read more
Source§

impl<C: Clone, S: Clone> Clone for Split<C, S>

Source§

fn clone(&self) -> Split<C, S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<C: Debug, S: Debug> Debug for Split<C, S>

Source§

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

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

impl<C: Default, S: Default> Default for Split<C, S>

Source§

fn default() -> Split<C, S>

Returns the “default value” for a type. Read more
Source§

impl<C, S, const N: usize> From<[Split<C, S>; N]> for Split<[C; N], [S; N]>

Unzip multiple splits

Source§

fn from(splits: [Split<C, S>; N]) -> Self

Converts to this type from the input type.
Source§

impl<C0, C1, S0, S1> From<(Split<C0, S0>, Split<C1, S1>)> for Split<(C0, C1), (S0, S1)>

Unzip two splits

Source§

fn from(value: (Split<C0, S0>, Split<C1, S1>)) -> Self

Converts to this type from the input type.
Source§

impl<X: Copy, S: ?Sized, C: SplitInplace<X, S> + ?Sized> Inplace<X> for Split<&C, &mut S>

Source§

fn inplace(&mut self, xy: &mut [X])

Process an input block into the same data as output
Source§

impl<C0, C1, S0, S1> Mul<Split<C1, S1>> for Split<C0, S0>

Unzip two splits into one

Source§

type Output = Split<(C0, C1), (S0, S1)>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Split<C1, S1>) -> Self::Output

Performs the * operation. Read more
Source§

impl<X: Copy, Y, S: ?Sized, C: SplitProcess<X, Y, S> + ?Sized> Process<X, Y> for Split<&C, &mut S>

Source§

fn process(&mut self, x: X) -> Y

Update the state with a new input and obtain an output
Source§

fn block(&mut self, x: &[X], y: &mut [Y])

Process a block of inputs into a block of outputs Read more
Source§

impl<C: Copy, S: Copy> Copy for Split<C, S>

Auto Trait Implementations§

§

impl<C, S> Freeze for Split<C, S>
where C: Freeze, S: Freeze,

§

impl<C, S> RefUnwindSafe for Split<C, S>

§

impl<C, S> Send for Split<C, S>
where C: Send, S: Send,

§

impl<C, S> Sync for Split<C, S>
where C: Sync, S: Sync,

§

impl<C, S> Unpin for Split<C, S>
where C: Unpin, S: Unpin,

§

impl<C, S> UnwindSafe for Split<C, S>
where C: UnwindSafe, S: UnwindSafe,

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<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.