pub enum LedgerStateSnapshot {
Legacy {
path: PathBuf,
slot_number: SlotNumber,
filename: OsString,
},
InMemoryUpTo10_6 {
path: PathBuf,
slot_number: SlotNumber,
folder_name: OsString,
},
InMemoryFrom10_7 {
path: PathBuf,
slot_number: SlotNumber,
folder_name: OsString,
},
}Expand description
Represent a ledger file in a Cardano node database directory
Variants§
Legacy
Snapshot of a legacy ledger state (before UTxO-HD)
Fields
slot_number: SlotNumberThe ledger file slot number
InMemoryUpTo10_6
Snapshot of a UTxO-HD in-memory ledger state (Cardano node up to 10.6)
Fields
slot_number: SlotNumberThe ledger file slot number
InMemoryFrom10_7
Snapshot of a UTxO-HD in-memory ledger state (Cardano node 10.7 and above)
Implementations§
Source§impl LedgerStateSnapshot
impl LedgerStateSnapshot
Sourcepub const IN_MEMORY_META: &'static str = "meta"
pub const IN_MEMORY_META: &'static str = "meta"
Filename of the in-memory ledger snapshot ‘meta’ file
Sourcepub const IN_MEMORY_STATE: &'static str = "state"
pub const IN_MEMORY_STATE: &'static str = "state"
Filename of the in-memory ledger snapshot ‘state’ file
Sourcepub const IN_MEMORY_TABLES: &'static str = "tables"
pub const IN_MEMORY_TABLES: &'static str = "tables"
Directory name of the in-memory ledger snapshot ‘tables’ folder
Sourcepub const IN_MEMORY_TVAR: &'static str = "tvar"
pub const IN_MEMORY_TVAR: &'static str = "tvar"
Filename of the in-memory ledger snapshot ‘tables/tvar’ file
Sourcepub fn legacy(
path: PathBuf,
slot_number: SlotNumber,
filename: OsString,
) -> Self
pub fn legacy( path: PathBuf, slot_number: SlotNumber, filename: OsString, ) -> Self
LedgerStateSnapshot::Legacy factory
Sourcepub fn from_path(path: &Path) -> Option<LedgerStateSnapshot>
pub fn from_path(path: &Path) -> Option<LedgerStateSnapshot>
Convert a path to a LedgerStateSnapshot if it satisfies the constraints.
The constraints are:
- legacy state snapshot: the path must be a file, the filename should only contain a number (no extension).
Sourcepub fn list_all_in_dir(
dir: &Path,
) -> Result<Vec<LedgerStateSnapshot>, LedgerStateSnapshotListingError>
pub fn list_all_in_dir( dir: &Path, ) -> Result<Vec<LedgerStateSnapshot>, LedgerStateSnapshotListingError>
List all LedgerStateSnapshot in a given directory.
Sourcepub fn get_files_relative_path(&self) -> Vec<PathBuf>
pub fn get_files_relative_path(&self) -> Vec<PathBuf>
Return paths to all files that constitute this snapshot
Returned paths are relative to the cardano node database ledger dir
Sourcepub fn slot_number(&self) -> SlotNumber
pub fn slot_number(&self) -> SlotNumber
Return the slot number when this snapshot was taken
Trait Implementations§
Source§impl Clone for LedgerStateSnapshot
impl Clone for LedgerStateSnapshot
Source§fn clone(&self) -> LedgerStateSnapshot
fn clone(&self) -> LedgerStateSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LedgerStateSnapshot
impl Debug for LedgerStateSnapshot
impl Eq for LedgerStateSnapshot
Source§impl Ord for LedgerStateSnapshot
impl Ord for LedgerStateSnapshot
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for LedgerStateSnapshot
impl PartialEq for LedgerStateSnapshot
Source§impl PartialOrd for LedgerStateSnapshot
impl PartialOrd for LedgerStateSnapshot
impl StructuralPartialEq for LedgerStateSnapshot
Auto Trait Implementations§
impl Freeze for LedgerStateSnapshot
impl RefUnwindSafe for LedgerStateSnapshot
impl Send for LedgerStateSnapshot
impl Sync for LedgerStateSnapshot
impl Unpin for LedgerStateSnapshot
impl UnsafeUnpin for LedgerStateSnapshot
impl UnwindSafe for LedgerStateSnapshot
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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