pub struct SchemaStage { /* private fields */ }Expand description
One bounded, invisible target record in a causal schema migration.
Implementations§
Source§impl SchemaStage
impl SchemaStage
Sourcepub fn new(
migration_id: MigrationId,
from: SchemaDescriptor,
to: SchemaDescriptor,
source_record_id: Vec<u8>,
source_digest: BlobHash,
target_record: Vec<u8>,
) -> Result<Self, MigrationCodecError>
pub fn new( migration_id: MigrationId, from: SchemaDescriptor, to: SchemaDescriptor, source_record_id: Vec<u8>, source_digest: BlobHash, target_record: Vec<u8>, ) -> Result<Self, MigrationCodecError>
Validates and constructs one staged record.
Sourcepub const fn migration_id(&self) -> MigrationId
pub const fn migration_id(&self) -> MigrationId
Returns the migration identifier.
Sourcepub const fn from(&self) -> &SchemaDescriptor
pub const fn from(&self) -> &SchemaDescriptor
Returns the exact predecessor schema.
Sourcepub const fn to(&self) -> &SchemaDescriptor
pub const fn to(&self) -> &SchemaDescriptor
Returns the exact target schema.
Sourcepub fn source_record_id(&self) -> &[u8] ⓘ
pub fn source_record_id(&self) -> &[u8] ⓘ
Returns the source record’s canonical primary key.
Sourcepub const fn source_digest(&self) -> BlobHash
pub const fn source_digest(&self) -> BlobHash
Returns the digest of the canonical source materialization.
Sourcepub fn target_record(&self) -> &[u8] ⓘ
pub fn target_record(&self) -> &[u8] ⓘ
Returns the canonical target materialized-record bytes.
Sourcepub fn encode_canonical(&self) -> Vec<u8> ⓘ
pub fn encode_canonical(&self) -> Vec<u8> ⓘ
Encodes the stage into its unique durable representation.
Sourcepub fn decode_canonical(bytes: &[u8]) -> Result<Self, MigrationCodecError>
pub fn decode_canonical(bytes: &[u8]) -> Result<Self, MigrationCodecError>
Strictly decodes one canonical stage.
Trait Implementations§
Source§impl Clone for SchemaStage
impl Clone for SchemaStage
Source§fn clone(&self) -> SchemaStage
fn clone(&self) -> SchemaStage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SchemaStage
impl Debug for SchemaStage
Source§impl PartialEq for SchemaStage
impl PartialEq for SchemaStage
impl Eq for SchemaStage
impl StructuralPartialEq for SchemaStage
Auto Trait Implementations§
impl Freeze for SchemaStage
impl RefUnwindSafe for SchemaStage
impl Send for SchemaStage
impl Sync for SchemaStage
impl Unpin for SchemaStage
impl UnwindSafe for SchemaStage
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
Mutably borrows from an owned value. Read more