use std::marker;
use crate::depot::{
queue::{indexed::slab, links},
raw::Live,
};
#[repr(transparent)]
pub(in crate::depot::queue::group) struct Node<Tag>(Key<Tag>);
impl<Tag> Node<Tag> {
pub(in crate::depot::queue::group) fn inserted(key: slab::Handle<Tag>) -> Self {
Self((links::Index::from(key), marker::PhantomData))
}
pub(in crate::depot::queue::group) fn bind<'a, S>(&'a self, source: S) -> Live<S, &'a Key<Tag>>
where
S: crate::depot::raw::Project<&'a Key<Tag>>,
{
unsafe { crate::depot::raw::Proof::new((source, &self.0)) }
}
}
const _: () = {
assert!(size_of::<Node<()>>() == size_of::<links::Index>());
assert!(size_of::<Option<Node<()>>>() == size_of::<links::Index>());
};
type Key<Tag> = (links::Index, marker::PhantomData<slab::Handle<Tag>>);