Skip to main content

Outputs

Trait Outputs 

Source
pub trait Outputs: Sized {
    type Per: Copy + Sync;
    type Cell<'a>
       where Self: 'a;
    type Shared: Sync;

    // Required methods
    fn new(count: usize, per: Self::Per) -> Self;
    fn shared(&mut self) -> Self::Shared;
    unsafe fn cell<'a>(
        shared: &'a Self::Shared,
        per: Self::Per,
        i: usize,
    ) -> Self::Cell<'a>
       where Self: 'a;
}
Expand description

A stack’s outputs: a tuple of one to three Vecs, each holding its own number of items for every cell in turn. stack gives each cell its part of each output, as a QR stack writes Q and R and an SVD stack U, S and V.

Required Associated Types§

Source

type Per: Copy + Sync

The items that each cell writes in each output.

Source

type Cell<'a>
where Self: 'a,

One cell’s part of each output.

Source

type Shared: Sync

The outputs’ items, shared with the threads that write their cells.

Required Methods§

Source

fn new(count: usize, per: Self::Per) -> Self

The outputs of count cells, each item at its default. vec! asks the allocator for zeroed memory where that default is zero bits, as for real numbers and integers, so no pass writes a large output before its cells do.

Source

fn shared(&mut self) -> Self::Shared

Pointers to the outputs’ items.

Source

unsafe fn cell<'a>( shared: &'a Self::Shared, per: Self::Per, i: usize, ) -> Self::Cell<'a>
where Self: 'a,

Cell i‘s part of each output. SAFETY: i must be below the outputs’ number of cells, and no other caller may hold cell i’s part at the same time.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<A: Clone + Default + Send + 'static, B: Clone + Default + Send + 'static, C: Clone + Default + Send + 'static> Outputs for (Vec<A>, Vec<B>, Vec<C>)

Source§

type Per = [usize; 3]

Source§

type Cell<'a> = (&'a mut [A], &'a mut [B], &'a mut [C])
where Self: 'a,

Source§

type Shared = (Shared<A>, Shared<B>, Shared<C>)

Source§

fn new(count: usize, per: [usize; 3]) -> Self

Source§

fn shared(&mut self) -> Self::Shared

Source§

unsafe fn cell<'a>( shared: &'a Self::Shared, per: [usize; 3], i: usize, ) -> Self::Cell<'a>
where Self: 'a,

Source§

impl<A: Clone + Default + Send + 'static, B: Clone + Default + Send + 'static> Outputs for (Vec<A>, Vec<B>)

Source§

type Per = [usize; 2]

Source§

type Cell<'a> = (&'a mut [A], &'a mut [B])
where Self: 'a,

Source§

type Shared = (Shared<A>, Shared<B>)

Source§

fn new(count: usize, per: [usize; 2]) -> Self

Source§

fn shared(&mut self) -> Self::Shared

Source§

unsafe fn cell<'a>( shared: &'a Self::Shared, per: [usize; 2], i: usize, ) -> Self::Cell<'a>
where Self: 'a,

Source§

impl<A: Clone + Default + Send + 'static> Outputs for (Vec<A>,)

Source§

type Per = [usize; 1]

Source§

type Cell<'a> = (&'a mut [A],)
where Self: 'a,

Source§

type Shared = (Shared<A>,)

Source§

fn new(count: usize, per: [usize; 1]) -> Self

Source§

fn shared(&mut self) -> Self::Shared

Source§

unsafe fn cell<'a>( shared: &'a Self::Shared, per: [usize; 1], i: usize, ) -> Self::Cell<'a>
where Self: 'a,

Implementors§