pub struct Database { /* private fields */ }

Implementations§

source§

impl Database

source

pub fn snapshot(&self, id: i64) -> Option<Snapshot>

Get a snapshot by its id, or None if no snapshot with that id exists

source

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

Get a list of all snapshots in the database

source

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

Get the current snapshot

source

pub fn set_current_snapshot(&self, value: &Snapshot)

source

pub fn write_snapshot_data<N: BnStrCompatible>( &self, parents: &[i64], file: &BinaryView, name: N, data: &KeyValueStore, auto_save: bool ) -> i64

source

pub fn write_snapshot_data_with_progress<N, F>( &self, parents: &[i64], file: &BinaryView, name: N, data: &KeyValueStore, auto_save: bool, progress: F ) -> i64
where N: BnStrCompatible, F: FnMut(usize, usize) -> bool,

source

pub fn trim_snapshot(&self, id: i64) -> Result<(), ()>

Trim a snapshot’s contents in the database by id, but leave the parent/child hierarchy intact. Future references to this snapshot will return False for has_contents

source

pub fn remove_snapshot(&self, id: i64) -> Result<(), ()>

Remove a snapshot in the database by id, deleting its contents and references. Attempting to remove a snapshot with children will raise an exception.

source

pub fn has_global<S: BnStrCompatible>(&self, key: S) -> bool

source

pub fn global_keys(&self) -> Array<BnString>

Get a list of keys for all globals in the database

source

pub fn globals(&self) -> HashMap<String, String>

Get a dictionary of all globals

source

pub fn read_global<S: BnStrCompatible>(&self, key: S) -> Option<BnString>

Get a specific global by key

source

pub fn write_global<K: BnStrCompatible, V: BnStrCompatible>( &self, key: K, value: V ) -> bool

Write a global into the database

source

pub fn read_global_data<S: BnStrCompatible>(&self, key: S) -> Option<DataBuffer>

Get a specific global by key, as a binary buffer

source

pub fn write_global_data<K: BnStrCompatible>( &self, key: K, value: &DataBuffer ) -> bool

Write a binary buffer into a global in the database

source

pub fn file(&self) -> FileMetadata

Get the owning FileMetadata

source

pub fn analysis_cache(&self) -> KeyValueStore

Get the backing analysis cache kvs

source

pub fn reload_connection(&self)

source

pub fn write_analysis_cache(&self, val: &KeyValueStore) -> Result<(), ()>

source

pub fn snapshot_has_data(&self, id: i64) -> bool

Trait Implementations§

source§

impl Clone for Database

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 Drop for Database

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.