pub struct NestedReadonlySnapshot { /* private fields */ }Expand description
A nested read-only snapshot.
This is a read-only snapshot that has a parent snapshot. It inherits the parent’s invalid set and can be disposed independently.
§Thread Safety
Contains Cell<T> and RefCell<T> which are not Send/Sync. This is safe because
snapshots are stored in thread-local storage and never shared across threads. The Arc
is used for cheap cloning within a single thread, not for cross-thread sharing.
Implementations§
Source§impl NestedReadonlySnapshot
impl NestedReadonlySnapshot
pub fn new( id: SnapshotId, invalid: SnapshotIdSet, read_observer: Option<ReadObserver>, parent: Weak<NestedReadonlySnapshot>, ) -> Arc<Self>
pub fn snapshot_id(&self) -> SnapshotId
pub fn invalid(&self) -> SnapshotIdSet
pub fn read_only(&self) -> bool
pub fn root_nested_readonly(&self) -> Arc<NestedReadonlySnapshot>
pub fn enter<T>(self: &Arc<Self>, f: impl FnOnce() -> T) -> T
pub fn take_nested_snapshot( &self, read_observer: Option<ReadObserver>, ) -> Arc<NestedReadonlySnapshot>
pub fn has_pending_changes(&self) -> bool
pub fn dispose(&self)
pub fn record_read(&self, state: &dyn StateObject)
pub fn record_write(&self, _state: Arc<dyn StateObject>)
pub fn close(&self)
pub fn is_disposed(&self) -> bool
Auto Trait Implementations§
impl !Freeze for NestedReadonlySnapshot
impl !RefUnwindSafe for NestedReadonlySnapshot
impl !Send for NestedReadonlySnapshot
impl !Sync for NestedReadonlySnapshot
impl Unpin for NestedReadonlySnapshot
impl !UnwindSafe for NestedReadonlySnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more