use std::collections::HashSet;
use std::error::Error;
pub trait OrdererStore<ID> {
type Error: Error;
fn mark_ready(&self, id: ID) -> impl Future<Output = Result<bool, Self::Error>>;
fn mark_pending(
&self,
id: ID,
dependencies: Vec<ID>,
) -> impl Future<Output = Result<bool, Self::Error>>;
#[allow(clippy::type_complexity)]
fn get_next_pending(
&self,
id: ID,
) -> impl Future<Output = Result<Option<HashSet<(ID, Vec<ID>)>>, Self::Error>>;
fn take_next_ready(&self) -> impl Future<Output = Result<Option<ID>, Self::Error>>;
fn remove_pending(&self, id: ID) -> impl Future<Output = Result<bool, Self::Error>>;
fn ready(&self, keys: &[ID]) -> impl Future<Output = Result<bool, Self::Error>>;
}
#[cfg(any(test, feature = "test_utils"))]
pub trait OrdererTestExt {
fn ready_len(&self) -> impl Future<Output = usize>;
fn ready_queue_len(&self) -> impl Future<Output = usize>;
fn pending_len(&self) -> impl Future<Output = usize>;
}