use std::fmt::Debug;
use serde::{de::DeserializeOwned, Serialize};
use wincode::{SchemaRead, SchemaWrite};
use crate::{
random::RandomWith,
sharing::{PairwiseAuthenticated, Reconstructible, Verifiable},
types::Batched,
};
pub mod bundler;
pub mod generator;
pub mod stream;
pub mod types;
pub use types::{dabits, powpairs, singlets, triples};
pub trait Correlation:
'static
+ Debug
+ Sized
+ Send
+ Sync
+ Clone
+ PartialEq
+ Serialize
+ DeserializeOwned
+ SchemaWrite<Src = Self>
+ for<'a> SchemaRead<'a>
+ Reconstructible
+ Verifiable
+ PairwiseAuthenticated
+ RandomWith<Vec<Self::GlobalAuthKey>>
{
}
impl<
T: 'static
+ Debug
+ Sized
+ Send
+ Sync
+ Clone
+ PartialEq
+ Serialize
+ DeserializeOwned
+ Verifiable
+ PairwiseAuthenticated
+ RandomWith<Vec<Self::GlobalAuthKey>>
+ for<'a> wincode::SchemaRead<'a, Dst = T>
+ wincode::SchemaWrite<Src = T>,
> Correlation for T
{
}
pub trait CorrelatedBatch:
Correlation<GlobalAuthKey = <Self::Item as PairwiseAuthenticated>::GlobalAuthKey>
+ Batched<Item: Correlation>
{
}
impl<
T: Correlation<GlobalAuthKey = <T::Item as PairwiseAuthenticated>::GlobalAuthKey>
+ Batched<Item: Correlation>,
> CorrelatedBatch for T
{
}