Struct matterdb::Patch [−][src]
pub struct Patch { /* fields omitted */ }
A set of changes that can be atomically applied to a Database
.
This set can contain changes from multiple indexes. Changes can be read from the Patch
using its RawAccess
implementation.
Examples
let db = TemporaryDB::new(); let fork = db.fork(); fork.get_list("list").extend(vec![1_i32, 2, 3]); let patch: Patch = fork.into_patch(); // The patch contains changes recorded in the fork. let list = patch.get_list::<_, i32>("list"); assert_eq!(list.len(), 3);
Trait Implementations
impl AsReadonly for &Patch
[src]
impl AsReadonly for &Patch
[src]type Readonly = Self
type Readonly = Self
Readonly version of the access.
fn as_readonly(&self) -> Self::Readonly
[src]
fn as_readonly(&self) -> Self::Readonly
[src]Performs the conversion.
impl From<Patch> for Fork
[src]
impl From<Patch> for Fork
[src]fn from(patch: Patch) -> Self
[src]
fn from(patch: Patch) -> Self
[src]Creates a fork based on the provided patch
and snapshot
.
Note: using created fork to modify data already present in patch
may lead
to an inconsistent database state. Hence, this method is useful only if you
are sure that the fork and patch
interacted with different indexes.
impl RawAccess for &Patch
[src]
impl RawAccess for &Patch
[src]impl Snapshot for Patch
[src]
impl Snapshot for Patch
[src]fn get(&self, name: &ResolvedAddress, key: &[u8]) -> Option<Vec<u8>>
[src]
fn get(&self, name: &ResolvedAddress, key: &[u8]) -> Option<Vec<u8>>
[src]Returns a value corresponding to the specified address and key as a raw vector of bytes,
or None
if it does not exist. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Patch
impl Send for Patch
impl Sync for Patch
impl Unpin for Patch
impl !UnwindSafe for Patch
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T