use crate::alloc::Box;
pub(crate) mod deep;
pub(crate) mod lending;
pub(crate) mod mut_lending;
pub(crate) mod owning;
pub(crate) mod shallow;
pub(crate) mod static_ref;
#[derive(Debug)]
#[doc(hidden)]
pub enum OutputError {
OwnershipRequired,
NoMutexApi,
}
type OutputResult<T> = Result<T, OutputError>;
pub trait Kind: 'static {
type Return: GetOutput;
}
pub trait Return: Kind {
type Type: 'static;
}
pub trait GetOutput: Sized + 'static {
type Output<'u>
where
Self: 'u;
fn output(&self) -> Option<Self::Output<'_>>;
}
pub trait IntoReturnOnce<K: Kind> {
#[doc(hidden)]
fn into_return_once(self) -> OutputResult<K::Return>;
}
pub trait IntoReturn<K: Kind>: IntoReturnOnce<K> {
#[doc(hidden)]
fn into_return(self) -> OutputResult<K::Return>;
}
pub trait ReturnDefault<K: Kind> {
#[doc(hidden)]
fn return_default() -> K::Return;
}
pub struct Mutable<T>(pub(crate) T);
pub use deep::Deep;
pub use lending::Lending;
pub use mut_lending::MutLending;
pub use owning::Owning;
pub use shallow::Shallow;
pub use static_ref::StaticRef;