Struct matterdb::Patch [−][src]
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 Debug for Patch
[src]
impl From<Patch> for Fork
[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]
type Changes = ()
Type of the changes()
that will be applied to the database.
fn snapshot(&self) -> &dyn Snapshot
[src]
fn changes(&self, _address: &ResolvedAddress) -> Self::Changes
[src]
impl Snapshot for Patch
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,