Skip to main content

PatchsetOp

Enum PatchsetOp 

Source
pub enum PatchsetOp<'a, T, S, B> {
    Insert {
        table: &'a T,
        values: &'a [Value<S, B>],
        indirect: bool,
    },
    Update {
        table: &'a T,
        pk: &'a [Value<S, B>],
        entries: &'a [PatchsetUpdateEntry<S, B>],
        indirect: bool,
    },
    Delete {
        table: &'a T,
        pk: &'a [Value<S, B>],
        indirect: bool,
    },
}
Expand description

View over one operation in a patchset.

Variants§

§

Insert

INSERT. Carries every column’s value in column order.

Fields

§table: &'a T

Table this row belongs to.

§values: &'a [Value<S, B>]

Full row values, one per column.

§indirect: bool

SQLite session-extension indirect flag.

§

Update

UPDATE. Carries primary-key values plus a (unit, new) entry per non-PK column. The unit reflects the patchset format’s missing old-value storage; consumers can map |(_, v)| v to walk just the new values.

Fields

§table: &'a T

Table this row belongs to.

§pk: &'a [Value<S, B>]

Primary-key column values for the row being updated.

§entries: &'a [PatchsetUpdateEntry<S, B>]

(unit, new) entries, one per column.

§indirect: bool

SQLite session-extension indirect flag.

§

Delete

DELETE. Carries only the primary-key columns; the rest of the old row is not stored in patchset format.

Fields

§table: &'a T

Table this row belongs to.

§pk: &'a [Value<S, B>]

Primary-key column values for the row being deleted.

§indirect: bool

SQLite session-extension indirect flag.

Implementations§

Source§

impl<'a, T, S, B> PatchsetOp<'a, T, S, B>

Source

pub fn table(&self) -> &'a T

Returns the schema of the table this operation applies to.

Source

pub fn indirect(&self) -> bool

Returns the SQLite session-extension indirect flag.

Source

pub fn update_new_values(&self) -> Option<Vec<&'a Option<Value<S, B>>>>

For an Update op, returns the new values per column (with the unit dropped). Returns None for Insert and Delete.

Trait Implementations§

Source§

impl<'a, T: Debug, S: Debug, B: Debug> Debug for PatchsetOp<'a, T, S, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T, S, B> Freeze for PatchsetOp<'a, T, S, B>

§

impl<'a, T, S, B> RefUnwindSafe for PatchsetOp<'a, T, S, B>

§

impl<'a, T, S, B> Send for PatchsetOp<'a, T, S, B>
where T: Sync, S: Sync, B: Sync,

§

impl<'a, T, S, B> Sync for PatchsetOp<'a, T, S, B>
where T: Sync, S: Sync, B: Sync,

§

impl<'a, T, S, B> Unpin for PatchsetOp<'a, T, S, B>

§

impl<'a, T, S, B> UnsafeUnpin for PatchsetOp<'a, T, S, B>

§

impl<'a, T, S, B> UnwindSafe for PatchsetOp<'a, T, S, B>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.