pub struct EnvironmentSnapshot {
pub names: Vec<Name>,
}Expand description
A snapshot of an Environment at a point in time.
Snapshots are useful for implementing undo/redo in interactive mode.
Fields§
§names: Vec<Name>Names present at snapshot time, in insertion order.
Implementations§
Source§impl EnvironmentSnapshot
impl EnvironmentSnapshot
Sourcepub fn from_env(env: &Environment) -> Self
pub fn from_env(env: &Environment) -> Self
Create a snapshot from an environment.
Sourcepub fn diff<'a>(&self, new: &'a EnvironmentSnapshot) -> Vec<&'a Name>
pub fn diff<'a>(&self, new: &'a EnvironmentSnapshot) -> Vec<&'a Name>
Return the names added in new that were not in self.
Trait Implementations§
Source§impl Clone for EnvironmentSnapshot
impl Clone for EnvironmentSnapshot
Source§fn clone(&self) -> EnvironmentSnapshot
fn clone(&self) -> EnvironmentSnapshot
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 EnvironmentSnapshot
impl RefUnwindSafe for EnvironmentSnapshot
impl Send for EnvironmentSnapshot
impl Sync for EnvironmentSnapshot
impl Unpin for EnvironmentSnapshot
impl UnsafeUnpin for EnvironmentSnapshot
impl UnwindSafe for EnvironmentSnapshot
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