Trait seec::protocols::ShareStorage

source ·
pub trait ShareStorage<Share>: IntoIterator<Item = Share> + FromIterator<Share> + Clone + Default + Debug + Send + Sync {
    // Required methods
    fn len(&self) -> usize;
    fn repeat(val: Share, len: usize) -> Self;
    fn set(&mut self, idx: usize, val: Share);
    fn get(&self, idx: usize) -> Share;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn random<Rng: RngCore>(size: usize, rng: &mut Rng) -> Self
       where Standard: Distribution<Share> { ... }
}

Required Methods§

source

fn len(&self) -> usize

source

fn repeat(val: Share, len: usize) -> Self

source

fn set(&mut self, idx: usize, val: Share)

source

fn get(&self, idx: usize) -> Share

Provided Methods§

source

fn is_empty(&self) -> bool

source

fn random<Rng: RngCore>(size: usize, rng: &mut Rng) -> Self
where Standard: Distribution<Share>,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<R: Ring> ShareStorage<R> for Vec<R>

source§

fn len(&self) -> usize

source§

fn repeat(val: R, len: usize) -> Self

source§

fn set(&mut self, idx: usize, val: R)

source§

fn get(&self, idx: usize) -> R

Implementors§