use crate::buffer::{self, pool, pool::owners, storage};
#[derive(Debug)]
pub struct Frozen;
unsafe impl<L> buffer::raw::Source for pool::Span<owners::Plain<L>, pool::Owned, Frozen> where
owners::Plain<L>: crate::buffer::raw::Backing
{
}
impl<L> pool::Span<owners::Plain<L>, pool::Owned, Frozen>
where
owners::Plain<L>: crate::buffer::raw::Backing,
{
#[must_use]
pub fn into_shared(self) -> storage::Shared {
let len = self.len();
unsafe { pool::raw::into_shared(self, 0, len) }.into()
}
}
impl<'d, S: pool::state::State> pool::Span<owners::Charged<'d>, pool::Owned, S> {
#[must_use]
#[inline]
pub fn freeze(self) -> buffer::resident::Shared<'d> {
let len = self.len();
unsafe { pool::raw::into_shared(self, 0, len) }.into()
}
}