pub struct DiffSet<F: Format<S, B>, T: SchemaWithPK, S, B> { /* private fields */ }Expand description
A frozen changeset or patchset whose rows are emitted in stored order.
DiffSet is produced by the binary parser (via ParsedDiffSet)
or by converting from a DiffSetBuilder using Into::into. Unlike
DiffSetBuilder, it stores tables and rows in a plain Vec, reflecting
the fact that no further mutation or PK-based lookup is needed.
build serializes rows in the order they are stored. No
session hash-table simulation is applied. This preserves the original
row order of parsed binary data across roundtrips.
To modify a DiffSet, convert it back to a DiffSetBuilder using
Into::into.
Implementations§
Source§impl<F: Format<S, B>, T: SchemaWithPK, S: AsRef<str> + Hash + Eq, B: AsRef<[u8]> + Hash + Eq> DiffSet<F, T, S, B>
impl<F: Format<S, B>, T: SchemaWithPK, S: AsRef<str> + Hash + Eq, B: AsRef<[u8]> + Hash + Eq> DiffSet<F, T, S, B>
Source§impl<F: Format<S, B>, T: SchemaWithPK, S: AsRef<str> + Hash + Eq, B: AsRef<[u8]> + Hash + Eq> DiffSet<F, T, S, B>
impl<F: Format<S, B>, T: SchemaWithPK, S: AsRef<str> + Hash + Eq, B: AsRef<[u8]> + Hash + Eq> DiffSet<F, T, S, B>
Source§impl<T: SchemaWithPK, S: Clone + Debug + AsRef<str>, B: Clone + Debug + AsRef<[u8]>> DiffSet<ChangesetFormat, T, S, B>
impl<T: SchemaWithPK, S: Clone + Debug + AsRef<str>, B: Clone + Debug + AsRef<[u8]>> DiffSet<ChangesetFormat, T, S, B>
Sourcepub fn iter(&self) -> impl Iterator<Item = ChangesetOp<'_, T, S, B>>
pub fn iter(&self) -> impl Iterator<Item = ChangesetOp<'_, T, S, B>>
Iterate over every operation in the changeset.
Operations are yielded in stored order, grouped by table. Each
ChangesetOp borrows from this DiffSet, so the returned
iterator is invalidated when the DiffSet is dropped or mutated.
Source§impl<T: SchemaWithPK, S: Clone + AsRef<str>, B: Clone + AsRef<[u8]>> DiffSet<PatchsetFormat, T, S, B>
impl<T: SchemaWithPK, S: Clone + AsRef<str>, B: Clone + AsRef<[u8]>> DiffSet<PatchsetFormat, T, S, B>
Sourcepub fn iter(&self) -> impl Iterator<Item = PatchsetOp<'_, T, S, B>>
pub fn iter(&self) -> impl Iterator<Item = PatchsetOp<'_, T, S, B>>
Iterate over every operation in the patchset.
Operations are yielded in stored order, grouped by table. Each
PatchsetOp borrows from this DiffSet. For DELETE and UPDATE
ops only the primary-key columns are available (patchset format
does not carry full old-row values).
Trait Implementations§
Source§impl<F: Clone + Format<S, B>, T: Clone + SchemaWithPK, S: Clone, B: Clone> Clone for DiffSet<F, T, S, B>
impl<F: Clone + Format<S, B>, T: Clone + SchemaWithPK, S: Clone, B: Clone> Clone for DiffSet<F, T, S, B>
Source§impl<F: Debug + Format<S, B>, T: Debug + SchemaWithPK, S: Debug, B: Debug> Debug for DiffSet<F, T, S, B>
impl<F: Debug + Format<S, B>, T: Debug + SchemaWithPK, S: Debug, B: Debug> Debug for DiffSet<F, T, S, B>
Source§impl<F: Format<S, B>, T: SchemaWithPK, S: AsRef<str> + Hash + Eq, B: AsRef<[u8]> + Hash + Eq> Default for DiffSet<F, T, S, B>
impl<F: Format<S, B>, T: SchemaWithPK, S: AsRef<str> + Hash + Eq, B: AsRef<[u8]> + Hash + Eq> Default for DiffSet<F, T, S, B>
Source§impl<T: SchemaWithPK, S: Clone + Debug + Hash + Eq + AsRef<str>, B: Clone + Debug + Hash + Eq + AsRef<[u8]>> DiffOps<T, S, B> for DiffSet<ChangesetFormat, T, S, B>
impl<T: SchemaWithPK, S: Clone + Debug + Hash + Eq + AsRef<str>, B: Clone + Debug + Hash + Eq + AsRef<[u8]>> DiffOps<T, S, B> for DiffSet<ChangesetFormat, T, S, B>
Source§type Format = ChangesetFormat
type Format = ChangesetFormat
Source§fn insert(
self,
insert: Insert<T, S, B>,
) -> DiffSetBuilder<ChangesetFormat, T, S, B>
fn insert( self, insert: Insert<T, S, B>, ) -> DiffSetBuilder<ChangesetFormat, T, S, B>
Source§fn delete(
self,
delete: ChangeDelete<T, S, B>,
) -> DiffSetBuilder<ChangesetFormat, T, S, B>
fn delete( self, delete: ChangeDelete<T, S, B>, ) -> DiffSetBuilder<ChangesetFormat, T, S, B>
Source§fn update(
self,
update: Update<T, ChangesetFormat, S, B>,
) -> DiffSetBuilder<ChangesetFormat, T, S, B>
fn update( self, update: Update<T, ChangesetFormat, S, B>, ) -> DiffSetBuilder<ChangesetFormat, T, S, B>
Source§impl<T: SchemaWithPK, S: Clone + Hash + Eq + AsRef<str>, B: Clone + Hash + Eq + AsRef<[u8]>> DiffOps<T, S, B> for DiffSet<PatchsetFormat, T, S, B>
impl<T: SchemaWithPK, S: Clone + Hash + Eq + AsRef<str>, B: Clone + Hash + Eq + AsRef<[u8]>> DiffOps<T, S, B> for DiffSet<PatchsetFormat, T, S, B>
Source§type Format = PatchsetFormat
type Format = PatchsetFormat
Source§fn insert(
self,
insert: Insert<T, S, B>,
) -> DiffSetBuilder<PatchsetFormat, T, S, B>
fn insert( self, insert: Insert<T, S, B>, ) -> DiffSetBuilder<PatchsetFormat, T, S, B>
Source§fn delete(
self,
delete: PatchDelete<T, S, B>,
) -> DiffSetBuilder<PatchsetFormat, T, S, B>
fn delete( self, delete: PatchDelete<T, S, B>, ) -> DiffSetBuilder<PatchsetFormat, T, S, B>
Source§fn update(
self,
update: Update<T, PatchsetFormat, S, B>,
) -> DiffSetBuilder<PatchsetFormat, T, S, B>
fn update( self, update: Update<T, PatchsetFormat, S, B>, ) -> DiffSetBuilder<PatchsetFormat, T, S, B>
impl<F: Format<S, B>, T: SchemaWithPK, S, B> Eq for DiffSet<F, T, S, B>
Source§impl<T: SchemaWithPK, S: Clone + Debug + Hash + Eq + AsRef<str>, B: Clone + Debug + Hash + Eq + AsRef<[u8]>> From<&DiffSet<ChangesetFormat, T, S, B>> for Vec<u8>
impl<T: SchemaWithPK, S: Clone + Debug + Hash + Eq + AsRef<str>, B: Clone + Debug + Hash + Eq + AsRef<[u8]>> From<&DiffSet<ChangesetFormat, T, S, B>> for Vec<u8>
Source§fn from(diffset: &DiffSet<ChangesetFormat, T, S, B>) -> Self
fn from(diffset: &DiffSet<ChangesetFormat, T, S, B>) -> Self
Source§impl<T: SchemaWithPK, S: AsRef<str> + Clone + Hash + Eq, B: AsRef<[u8]> + Clone + Hash + Eq> From<&DiffSet<PatchsetFormat, T, S, B>> for Vec<u8>
impl<T: SchemaWithPK, S: AsRef<str> + Clone + Hash + Eq, B: AsRef<[u8]> + Clone + Hash + Eq> From<&DiffSet<PatchsetFormat, T, S, B>> for Vec<u8>
Source§fn from(diffset: &DiffSet<PatchsetFormat, T, S, B>) -> Self
fn from(diffset: &DiffSet<PatchsetFormat, T, S, B>) -> Self
Source§impl<T: SchemaWithPK, S: Clone + Debug + Hash + Eq + AsRef<str>, B: Clone + Debug + Hash + Eq + AsRef<[u8]>> From<DiffSet<ChangesetFormat, T, S, B>> for Vec<u8>
impl<T: SchemaWithPK, S: Clone + Debug + Hash + Eq + AsRef<str>, B: Clone + Debug + Hash + Eq + AsRef<[u8]>> From<DiffSet<ChangesetFormat, T, S, B>> for Vec<u8>
Source§fn from(diffset: DiffSet<ChangesetFormat, T, S, B>) -> Self
fn from(diffset: DiffSet<ChangesetFormat, T, S, B>) -> Self
Source§impl<F: Format<S, B>, T: SchemaWithPK, S: Hash + Eq + AsRef<str>, B: Hash + Eq + AsRef<[u8]>> From<DiffSet<F, T, S, B>> for DiffSetBuilder<F, T, S, B>
impl<F: Format<S, B>, T: SchemaWithPK, S: Hash + Eq + AsRef<str>, B: Hash + Eq + AsRef<[u8]>> From<DiffSet<F, T, S, B>> for DiffSetBuilder<F, T, S, B>
Source§impl<T: SchemaWithPK, S: AsRef<str> + Clone + Hash + Eq, B: AsRef<[u8]> + Clone + Hash + Eq> From<DiffSet<PatchsetFormat, T, S, B>> for Vec<u8>
impl<T: SchemaWithPK, S: AsRef<str> + Clone + Hash + Eq, B: AsRef<[u8]> + Clone + Hash + Eq> From<DiffSet<PatchsetFormat, T, S, B>> for Vec<u8>
Source§fn from(diffset: DiffSet<PatchsetFormat, T, S, B>) -> Self
fn from(diffset: DiffSet<PatchsetFormat, T, S, B>) -> Self
Source§impl<F: Format<S, B>, T: SchemaWithPK, S: Hash + Eq + AsRef<str>, B: Hash + Eq + AsRef<[u8]>> From<DiffSetBuilder<F, T, S, B>> for DiffSet<F, T, S, B>
impl<F: Format<S, B>, T: SchemaWithPK, S: Hash + Eq + AsRef<str>, B: Hash + Eq + AsRef<[u8]>> From<DiffSetBuilder<F, T, S, B>> for DiffSet<F, T, S, B>
Source§fn from(builder: DiffSetBuilder<F, T, S, B>) -> Self
fn from(builder: DiffSetBuilder<F, T, S, B>) -> Self
Source§impl<F: Format<S, B>, T: SchemaWithPK, S, B> PartialEq for DiffSet<F, T, S, B>
Custom PartialEq that ignores tables with no operations (same semantics
as DiffSetBuilder).
impl<F: Format<S, B>, T: SchemaWithPK, S, B> PartialEq for DiffSet<F, T, S, B>
Custom PartialEq that ignores tables with no operations (same semantics
as DiffSetBuilder).
Auto Trait Implementations§
impl<F, T, S, B> Freeze for DiffSet<F, T, S, B>
impl<F, T, S, B> RefUnwindSafe for DiffSet<F, T, S, B>where
T: RefUnwindSafe,
<F as Format<S, B>>::DeleteData: RefUnwindSafe,
S: RefUnwindSafe,
B: RefUnwindSafe,
<F as Format<S, B>>::Old: RefUnwindSafe,
impl<F, T, S, B> Send for DiffSet<F, T, S, B>
impl<F, T, S, B> Sync for DiffSet<F, T, S, B>
impl<F, T, S, B> Unpin for DiffSet<F, T, S, B>
impl<F, T, S, B> UnsafeUnpin for DiffSet<F, T, S, B>
impl<F, T, S, B> UnwindSafe for DiffSet<F, T, S, B>where
T: UnwindSafe,
<F as Format<S, B>>::DeleteData: UnwindSafe,
S: UnwindSafe,
B: UnwindSafe,
<F as Format<S, B>>::Old: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.