pub mod buffered;
pub mod errors;
pub mod futures;
use std::fmt::Debug;
pub use buffered::{Buffer, BufferConfig, BufferedStream, PrefetchHandle, SharedBufferConfig};
pub use errors::CorrelatedStreamError;
pub use futures::{CompletionHandle, Next, NextVec, NextVecIterator, ResyncHandle};
use crate::correlated_randomness::Correlation;
pub trait CorrelatedStream<P: Correlation>: Send {
type Error: Debug + Clone + From<CorrelatedStreamError> + Send + 'static;
fn next_n(&self, n_elements: usize) -> Result<NextVec<P, Self::Error>, CorrelatedStreamError>;
fn prefetch_n(&self, _n_elements: usize) -> PrefetchHandle<Self::Error> {
PrefetchHandle::ready(Ok(()))
}
fn position(&self) -> u64;
fn resync(&self, target: u64) -> ResyncHandle<Self::Error>;
}