o3 0.62.0

shared-nothing primitives
Documentation
use crate::buffer::{self, resident};

#[derive(Debug)]
pub(in crate::buffer) enum Backing<'d> {
    Unique(buffer::raw::Heap<resident::Budget<'d>>),
    Shared(resident::State<'d>),
}

#[derive(Debug)]
#[repr(transparent)]
pub struct Owner<'d>(pub(in crate::buffer) Backing<'d>);

impl buffer::Residency for Owner<'_> {
    fn resident(&self) -> usize {
        match &self.0 {
            Backing::Unique(owner) => owner.capacity().get() as usize,
            Backing::Shared(owner) => owner.resident(),
        }
    }
}