Skip to main content

CommandMutationOverlay

Struct CommandMutationOverlay 

Source
pub struct CommandMutationOverlay { /* private fields */ }

Implementations§

Source§

impl CommandMutationOverlay

Source

pub fn visit_column_matches_with_catalog( overlays: &mut [Self], table: &str, fields: &[String], values: &[Value], control: &StorageReadControl, catalog: Option<&dyn SQLValueCatalog>, visit: &mut dyn FnMut(DocId) -> Result<(), SQLError>, ) -> Result<DocumentChanges, SQLError>

Source

pub fn column_matches( overlays: &mut [Self], table: &str, fields: &[String], values: &[Value], control: &StorageReadControl, ) -> Result<CommandIndexProbe, SQLError>

Source

pub fn column_matches_with_catalog( overlays: &mut [Self], table: &str, fields: &[String], values: &[Value], control: &StorageReadControl, catalog: Option<&dyn SQLValueCatalog>, ) -> Result<CommandIndexProbe, SQLError>

Source

pub fn visit_expression_matches_with_catalog( overlays: &mut [Self], table: &str, physical_key: &str, values: &[Value], control: &StorageReadControl, catalog: Option<&dyn SQLValueCatalog>, visit: &mut dyn FnMut(DocId) -> Result<(), SQLError>, ) -> Result<DocumentChanges, SQLError>

Visit already evaluated tuple keys before retaining the same command mask; the callback captures identities without evaluating row expressions.

Source

pub fn expression_matches( overlays: &mut [Self], table: &str, physical_key: &str, values: &[Value], control: &StorageReadControl, ) -> Result<CommandIndexProbe, SQLError>

Source

pub fn expression_matches_with_catalog( overlays: &mut [Self], table: &str, physical_key: &str, values: &[Value], control: &StorageReadControl, catalog: Option<&dyn SQLValueCatalog>, ) -> Result<CommandIndexProbe, SQLError>

Source§

impl CommandMutationOverlay

Source

pub fn holds(&self, table: &str) -> bool

Whether this command staged a row for table.

Source

pub fn staged_row_bound(overlays: &[Self], table: &str) -> u64

At least the number of rows overlays staged for table, without reading them; a row staged by several commands or staged again after it spilled counts more than once.

Source

pub fn row( overlays: &[Self], table: &str, id: DocId, control: &StorageReadControl, ) -> Result<Option<Option<CommandStoredDocument>>, SQLError>

The row the newest of overlays staged for id in table: its fields, or None for a row the command deleted. None when no command staged the row.

Source

pub fn stages( overlays: &[Self], table: &str, id: DocId, control: &StorageReadControl, ) -> Result<bool, SQLError>

Whether one of overlays staged a row for id in table.

Source

pub fn changes( overlays: &[Self], table: &str, base: DocumentChanges, control: &StorageReadControl, ) -> Result<DocumentChanges, SQLError>

base with the rows overlays staged for table above it, the newest command’s rows above the others. The rows are not copied; later stages do not change the result.

Source

pub fn stage( &mut self, table: &str, id: DocId, document: Option<(Arc<Document>, DocumentMetadata)>, control: &StorageReadControl, ) -> Result<(), SQLError>

Retain an evaluated row and prepare every cached-key change before publishing any row or index mutation.

Source

pub fn stage_evaluated( &mut self, table: &str, id: DocId, document: Option<CommandStoredDocument>, control: &StorageReadControl, ) -> Result<(), SQLError>

Publish an already evaluated row and its expression keys together.

Source

pub fn find_match( overlays: &mut [Self], table: &str, fields: &[String], values: &[Value], presence: FieldPresence, control: &StorageReadControl, ) -> Result<Option<DocId>, SQLError>

Probe exact canonical keys across command frames; newer replacements and tombstones mask older candidates. Candidate merging retains only the smallest visible identity.

Source

pub fn find_match_with_catalog( overlays: &mut [Self], table: &str, fields: &[String], values: &[Value], presence: FieldPresence, control: &StorageReadControl, catalog: Option<&dyn SQLValueCatalog>, ) -> Result<Option<DocId>, SQLError>

Retain catalog-dependent comparison semantics while newer frames mask older rows.

Source§

impl CommandMutationOverlay

Source

pub fn checkpoint(&self) -> CommandOverlayCheckpoint

Source

pub fn restore(&mut self, checkpoint: &CommandOverlayCheckpoint)

Source

pub fn published( overlays: &mut [Self], table: &str, id: DocId, document: Option<(Arc<Document>, DocumentMetadata)>, control: &StorageReadControl, ) -> Result<(), SQLError>

Replace every enclosing command’s staged image after a nested command writes it. This keeps later callbacks and exact-key probes on the newest version.

Source

pub fn published_evaluated( overlays: &mut [Self], table: &str, id: DocId, document: Option<CommandStoredDocument>, control: &StorageReadControl, ) -> Result<(), SQLError>

Refresh enclosing rows with the keys evaluated for their published image.

Source

pub fn published_rows(self) -> Option<Self>

Retain an ended command only when a nested command changed one of its staged rows.

Source

pub fn was_published( &self, table: &str, id: DocId, deleted_supersedes: bool, cancellation: &CancellationToken, ) -> Result<bool, SQLError>

Whether writing an identity would overwrite a nested command’s published row, including its deletion when deleted_supersedes holds.

Source

pub fn matches( overlays: &mut [Self], table: &str, fields: &[String], values: &[Value], control: &StorageReadControl, ) -> Result<BudgetedVec<DocId>, SQLError>

The visible rows overlays staged for table whose fields hold values, the newest command’s first; a missing field holds null.

Source

pub fn matches_with_catalog( overlays: &mut [Self], table: &str, fields: &[String], values: &[Value], control: &StorageReadControl, catalog: Option<&dyn SQLValueCatalog>, ) -> Result<BudgetedVec<DocId>, SQLError>

Source

pub fn visit_matches_with_catalog( overlays: &mut [Self], table: &str, fields: &[String], values: &[Value], control: &StorageReadControl, catalog: Option<&dyn SQLValueCatalog>, visit: &mut dyn FnMut(DocId) -> Result<(), SQLError>, ) -> Result<(), SQLError>

Trait Implementations§

Source§

impl Default for CommandMutationOverlay

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.