pub trait SnapAttemptStore {
// Required methods
fn start_snap_attempt(
&self,
generation: SnapGeneration,
) -> Result<SnapWrite, SnapSyncError>;
fn active_snap_write(&self) -> Result<Option<SnapWrite>, SnapSyncError>;
fn authorize_snap_write(
&self,
write: SnapWrite,
) -> Result<SnapAttempt, SnapSyncError>;
fn advance_snap_pivot(
&self,
write: SnapWrite,
generation: SnapGeneration,
) -> Result<SnapWrite, SnapSyncError>;
fn verify_snap_attempt(&self, write: SnapWrite) -> Result<(), SnapSyncError>;
fn abandon_snap_attempt(&self) -> Result<(), SnapSyncError>;
}Expand description
Persistence for the attempt that owns downloaded snap state.
Blanket-implemented over node metadata access, so these writes join the caller’s transaction: state, bytecode and the attempt record commit together or not at all.
Required Methods§
Sourcefn start_snap_attempt(
&self,
generation: SnapGeneration,
) -> Result<SnapWrite, SnapSyncError>
fn start_snap_attempt( &self, generation: SnapGeneration, ) -> Result<SnapWrite, SnapSyncError>
Starts an attempt anchored to generation, superseding any already recorded.
Sourcefn active_snap_write(&self) -> Result<Option<SnapWrite>, SnapSyncError>
fn active_snap_write(&self) -> Result<Option<SnapWrite>, SnapSyncError>
Returns the write an unfinished attempt accepts, if one owns the persisted state.
Returns the attempt when write still owns the persisted state, rejecting it otherwise.
Sourcefn advance_snap_pivot(
&self,
write: SnapWrite,
generation: SnapGeneration,
) -> Result<SnapWrite, SnapSyncError>
fn advance_snap_pivot( &self, write: SnapWrite, generation: SnapGeneration, ) -> Result<SnapWrite, SnapSyncError>
Re-anchors the attempt to generation, refusing writes proved against the previous root.
Sourcefn verify_snap_attempt(&self, write: SnapWrite) -> Result<(), SnapSyncError>
fn verify_snap_attempt(&self, write: SnapWrite) -> Result<(), SnapSyncError>
Marks the attempt’s downloaded state verified.
Sourcefn abandon_snap_attempt(&self) -> Result<(), SnapSyncError>
fn abandon_snap_attempt(&self) -> Result<(), SnapSyncError>
Gives up on an unfinished attempt, refusing its outstanding writes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".