o3 0.61.0

shared-nothing primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::base::cell::region::{self, Brand};

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

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

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