#![warn(missing_docs)]
#![deny(unused_qualifications)]
use std::hash::Hash;
use futures::{future::BoxFuture, stream::BoxStream, Future, Stream};
pub mod impl_;
#[derive(Debug, Clone)]
pub enum LockKind {
Shared,
Exclusive,
}
pub trait NameLocker: Send + Sync + 'static {
type Name: Ord + Hash + Send + Sync + 'static;
fn poll_with_lock<Output, Task>(
&self,
task: Task,
name: Option<Self::Name>,
lock_kind: LockKind,
) -> BoxFuture<'static, Output>
where
Task: Future<Output = Output> + Send + 'static;
fn poll_read_with_lock<'s, S>(
&self,
stream: S,
name: Option<Self::Name>,
lock_kind: LockKind,
) -> BoxStream<'s, S::Item>
where
S: Stream + Send + 's,
<S as Stream>::Item: Send;
}