Skip to main content

MultiVersionGetPrevious

Trait MultiVersionGetPrevious 

Source
pub trait MultiVersionGetPrevious: Send + Sync {
    // Required method
    fn get_previous_version(
        &self,
        key: &EncodedKey,
        before_version: CommitVersion,
    ) -> Result<Option<MultiVersionValues>>;
}
Expand description

Trait for getting the previous version of a key before a given version.

This trait allows looking up what value existed for a key before a specific version, which is essential for CDC (Change Data Capture) to determine if a change is an Insert, Update, or Delete.

Required Methods§

Source

fn get_previous_version( &self, key: &EncodedKey, before_version: CommitVersion, ) -> Result<Option<MultiVersionValues>>

Get the previous version of a key before the given version.

§Arguments
  • key - The encoded key to look up
  • before_version - Look for versions strictly before this version
§Returns
  • Ok(Some(values)) - Found a previous version with its value
  • Ok(None) - No previous version exists (this is the first version)
  • Err(_) - Lookup failed

Implementors§