pub struct DatabaseSnapshot {
pub format: String,
pub app_id: String,
pub contract_fingerprint: String,
pub records: Vec<Record>,
}Expand description
A backend-independent operator artifact tied to its logical migration contract.
Fields§
§format: String§app_id: String§contract_fingerprint: String§records: Vec<Record>Implementations§
Source§impl DatabaseSnapshot
impl DatabaseSnapshot
Sourcepub fn capture(
adapter: &dyn DatabaseOperations,
config: &DbBackendConfig,
contract: &AppDataContract,
) -> Result<Self, DatabaseError>
pub fn capture( adapter: &dyn DatabaseOperations, config: &DbBackendConfig, contract: &AppDataContract, ) -> Result<Self, DatabaseError>
Captures one consistent record view after checking the selected migration ledger.
Sourcepub fn restore(
&self,
adapter: &dyn DatabaseOperations,
config: &DbBackendConfig,
contract: &AppDataContract,
counts: &[RestoreCount],
) -> Result<(), DatabaseError>
pub fn restore( &self, adapter: &dyn DatabaseOperations, config: &DbBackendConfig, contract: &AppDataContract, counts: &[RestoreCount], ) -> Result<(), DatabaseError>
Checks artifact identity before replacing app records through the configured adapter.
Sourcepub fn encode(&self) -> Result<String, DatabaseError>
pub fn encode(&self) -> Result<String, DatabaseError>
Encodes a bounded portable archive without exposing connection configuration.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, DatabaseError>
pub fn decode(bytes: &[u8]) -> Result<Self, DatabaseError>
Rejects oversized or malformed input before allocating parsed record structures.
Trait Implementations§
Source§impl Clone for DatabaseSnapshot
impl Clone for DatabaseSnapshot
Source§fn clone(&self) -> DatabaseSnapshot
fn clone(&self) -> DatabaseSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DatabaseSnapshot
impl Debug for DatabaseSnapshot
Source§impl<'de> Deserialize<'de> for DatabaseSnapshot
impl<'de> Deserialize<'de> for DatabaseSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DatabaseSnapshot
impl RefUnwindSafe for DatabaseSnapshot
impl Send for DatabaseSnapshot
impl Sync for DatabaseSnapshot
impl Unpin for DatabaseSnapshot
impl UnsafeUnpin for DatabaseSnapshot
impl UnwindSafe for DatabaseSnapshot
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