o3 0.34.1

shared-nothing primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::buffer::{self, pool, pool::owners, storage};

/// A slot whose writable state has been consumed.
#[derive(Debug)]
pub struct Frozen;

// SAFETY: frozen ownership retains this exact initialized slot and visible range.
unsafe impl<L> buffer::raw::Source for pool::Span<owners::Plain<L>, pool::Owned, Frozen> {}

impl<L> pool::Span<owners::Plain<L>, pool::Owned, Frozen> {
    #[must_use]
    pub fn into_shared(self) -> storage::Shared {
        let len = self.len();
        // SAFETY: consuming the frozen span retains its exact initialized prefix.
        unsafe { pool::raw::into_shared(self, 0, len) }.into()
    }
}