o3 0.60.0

shared-nothing primitives
Documentation
use crate::base::cell::{
    local::Read,
    region::{self, Brand},
};

/// Scoped mutable access to one generative local region.
#[repr(transparent)]
pub struct Access<'borrow, B: Brand> {
    pub(in crate::base::cell) region: &'borrow mut region::Token<B>,
}

impl<'borrow, B: Brand> Access<'borrow, B> {
    pub fn new(region: &'borrow mut region::Token<B>) -> Self {
        Self { region }
    }

    pub fn reborrow(&mut self) -> Access<'_, B> {
        Access {
            region: self.region,
        }
    }

    pub fn read(&self) -> Read<'_, B> {
        Read::new(self.region)
    }

    /// Transfers the original exclusive token loan.
    pub fn into_inner(self) -> &'borrow mut region::Token<B> {
        self.region
    }
}