pub enum AnyMutableSnapshot {
Root(Arc<MutableSnapshot>),
Nested(Arc<NestedMutableSnapshot>),
}Expand description
Enum wrapper for mutable snapshot types.
This allows take_mutable_snapshot to return either a root MutableSnapshot
or a NestedMutableSnapshot depending on the current context, matching Kotlin’s
behavior where takeMutableSnapshot creates nested snapshots when inside a
mutable snapshot.
Variants§
Root(Arc<MutableSnapshot>)
Nested(Arc<NestedMutableSnapshot>)
Implementations§
Source§impl AnyMutableSnapshot
impl AnyMutableSnapshot
Sourcepub fn snapshot_id(&self) -> SnapshotId
pub fn snapshot_id(&self) -> SnapshotId
Get the snapshot ID.
Sourcepub fn invalid(&self) -> SnapshotIdSet
pub fn invalid(&self) -> SnapshotIdSet
Get the set of invalid snapshot IDs.
Sourcepub fn enter<T>(&self, f: impl FnOnce() -> T) -> T
pub fn enter<T>(&self, f: impl FnOnce() -> T) -> T
Enter this snapshot, making it current for the duration of the closure.
Sourcepub fn apply(&self) -> SnapshotApplyResult
pub fn apply(&self) -> SnapshotApplyResult
Apply the snapshot.
Trait Implementations§
Source§impl Clone for AnyMutableSnapshot
impl Clone for AnyMutableSnapshot
Source§fn clone(&self) -> AnyMutableSnapshot
fn clone(&self) -> AnyMutableSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AnyMutableSnapshot
impl !RefUnwindSafe for AnyMutableSnapshot
impl !Send for AnyMutableSnapshot
impl !Sync for AnyMutableSnapshot
impl Unpin for AnyMutableSnapshot
impl !UnwindSafe for AnyMutableSnapshot
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