pub struct Changeset;Expand description
Byte-transform entry points for changesets: Changeset::invert and
Changeset::concat, mirroring SQLite’s sqlite3changeset_invert and
sqlite3changeset_concat. This is a zero-sized namespace type — the
transforms need no database state.
Implementations§
Source§impl Changeset
impl Changeset
Sourcepub fn invert(changeset: &[u8]) -> Result<Vec<u8>>
pub fn invert(changeset: &[u8]) -> Result<Vec<u8>>
Return the inverse of changeset: applying the inverse undoes applying
the original. Mirrors sqlite3changeset_invert — INSERT↔DELETE, and
an UPDATE’s old and new values are swapped (primary-key columns
unchanged); table headers pass through.
§Errors
crate::error::Error::Corrupt if changeset is malformed.
Sourcepub fn concat(a: &[u8], b: &[u8]) -> Result<Vec<u8>>
pub fn concat(a: &[u8], b: &[u8]) -> Result<Vec<u8>>
Concatenate two changesets into one whose effect equals applying a
then b. Mirrors sqlite3changeset_concat: per-table, per-row changes
are coalesced exactly as an in-memory change-group would.
§Errors
crate::error::Error::Corrupt if either input is malformed or they
disagree on a table’s shape.