Struct Snapshot

Source
pub struct Snapshot { /* private fields */ }

Implementations§

Source§

impl Snapshot

Source

pub fn database(&self) -> Database

Get the owning database

Source

pub fn id(&self) -> SnapshotId

Get the numerical id

Source

pub fn name(&self) -> String

Get the displayed snapshot name

Source

pub fn set_name(&self, value: &str)

Set the displayed snapshot name

Source

pub fn is_auto_save(&self) -> bool

If the snapshot was the result of an auto-save

Source

pub fn has_contents(&self) -> bool

If the snapshot has contents, and has not been trimmed

Source

pub fn has_undo(&self) -> bool

If the snapshot has undo data

Source

pub fn first_parent(&self) -> Option<Snapshot>

Get the first parent of the snapshot, or None if it has no parents

Source

pub fn parents(&self) -> Array<Snapshot>

Get a list of all parent snapshots of the snapshot

Source

pub fn children(&self) -> Array<Snapshot>

Get a list of all child snapshots of the snapshot

Source

pub fn file_contents(&self) -> Option<DataBuffer>

Get a buffer of the raw data at the time of the snapshot

Source

pub fn file_contents_hash(&self) -> Option<DataBuffer>

Get a hash of the data at the time of the snapshot

Source

pub fn undo_entries(&self) -> Array<UndoEntry>

Get a list of undo entries at the time of the snapshot

Source

pub fn undo_entries_with_progress<P: ProgressCallback>( &self, progress: P, ) -> Array<UndoEntry>

Source

pub fn read_data(&self) -> Ref<KeyValueStore>

Get the backing kvs data with snapshot fields

Source

pub fn read_data_with_progress<P: ProgressCallback>( &self, progress: P, ) -> Ref<KeyValueStore>

Source

pub fn undo_data(&self) -> DataBuffer

Source

pub fn store_data(&self, data: &KeyValueStore) -> bool

Source

pub fn store_data_with_progress<P: ProgressCallback>( &self, data: &KeyValueStore, progress: P, ) -> bool

Source

pub fn has_ancestor(self, other: &Snapshot) -> bool

Determine if this snapshot has another as an ancestor

Trait Implementations§

Source§

impl CoreArrayProvider for Snapshot

Source§

impl Debug for Snapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ToOwned for Snapshot

Source§

type Owned = Ref<Snapshot>

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.