#![expect(dead_code)]
use crate::Permission;
pub trait Impl: 'static {
type Ptr<T>: Copy
where T: ?Sized;
type Ref<'a, T>
where T: 'a + ?Sized;
type Original: Impl;
const NAME: &'static str;
const IS_MUT: bool;
}
#[doc = include_str!("../doc/struct.Shared.md")]
pub struct Shared {
inner: (),
}
#[doc = include_str!("../doc/struct.Unique.md")]
pub struct Unique {
inner: (),
}
impl Shared {
pub(crate) const fn new() -> Self {
Self { inner: () }
}
}
impl Unique {
pub(crate) const fn new() -> Self {
Self { inner: () }
}
}
impl Impl for Shared {
type Original = Self;
type Ptr<T>
= *const T
where T: ?Sized;
type Ref<'a, T>
= &'a T
where T: 'a + ?Sized;
const IS_MUT: bool = false;
const NAME: &'static str = "const";
}
impl Impl for Unique {
type Original = Self;
type Ptr<T>
= *mut T
where T: ?Sized;
type Ref<'a, T>
= &'a mut T
where T: 'a + ?Sized;
const IS_MUT: bool = true;
const NAME: &'static str = "mut";
}
impl<P> Impl for (Shared, P)
where P: Impl
{
type Original = P::Original;
type Ptr<T>
= <Shared as Impl>::Ptr<T>
where T: ?Sized;
type Ref<'a, T>
= <Shared as Impl>::Ref<'a, T>
where T: 'a + ?Sized;
const IS_MUT: bool = Shared::IS_MUT;
const NAME: &'static str = Shared::NAME;
}
impl Permission for Shared {}
impl Permission for Unique {}
impl<P> Permission for (Shared, P) where P: Permission {}