primitives/correlated_randomness/
mod.rs1use std::fmt::Debug;
2
3use serde::{de::DeserializeOwned, Serialize};
4use wincode::{SchemaRead, SchemaWrite};
5
6use crate::{
7 sharing::{Reconstructible, Verifiable},
8 types::Batched,
9};
10
11pub mod bundler;
12pub mod generator;
13pub mod stream;
14pub mod types;
15
16pub use types::{dabits, powpairs, singlets, triples};
17
18pub trait Correlation:
22 'static
23 + Debug
24 + Sized
25 + Send
26 + Sync
27 + Clone
28 + PartialEq
29 + Serialize
30 + DeserializeOwned
31 + SchemaWrite<Src = Self>
32 + for<'a> SchemaRead<'a>
33 + Reconstructible
34 + Verifiable
35{
36}
37
38impl<
39 T: 'static
40 + Debug
41 + Sized
42 + Send
43 + Sync
44 + Clone
45 + PartialEq
46 + Serialize
47 + DeserializeOwned
48 + Verifiable
49 + for<'a> wincode::SchemaRead<'a, Dst = T>
50 + wincode::SchemaWrite<Src = T>,
51 > Correlation for T
52{
53}
54
55pub trait CorrelatedBatch: Correlation + Batched<Item: Correlation> {}
59impl<T: Correlation + Batched<Item: Correlation>> CorrelatedBatch for T {}