pub struct Snapshot { /* private fields */ }

Implementations§

source§

impl Snapshot

source

pub fn database(&self) -> Database

Get the owning database

source

pub fn id(&self) -> i64

Get the numerical id (read-only)

source

pub fn name(&self) -> BnString

Get the displayed snapshot name

source

pub fn set_name<S: BnStrCompatible>(&self, value: S)

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<F: FnMut(usize, usize) -> bool>( &self, progress: F ) -> Array<UndoEntry>

source

pub fn read_data(&self) -> KeyValueStore

Get the backing kvs data with snapshot fields

source

pub fn read_data_with_progress<F: FnMut(usize, usize) -> bool>( &self, progress: F ) -> KeyValueStore

source

pub fn undo_data(&self) -> DataBuffer

source

pub fn store_data<F: FnMut(usize, usize) -> bool>( &self, data: KeyValueStore, progress: F ) -> bool

source

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

Determine if this snapshot has another as an ancestor

Trait Implementations§

source§

impl Clone for Snapshot

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CoreArrayProvider for Snapshot

§

type Raw = *mut BNSnapshot

§

type Context = ()

§

type Wrapped<'a> = &'a Snapshot

source§

impl Drop for Snapshot

source§

fn drop(&mut self)

Executes the destructor for this type. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

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

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

§

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>,

§

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.