pub enum LedgerStateSnapshot {
Legacy {
path: PathBuf,
slot_number: SlotNumber,
filename: OsString,
},
InMemory {
path: PathBuf,
slot_number: SlotNumber,
folder_name: OsString,
},
}
Expand description
Represent an ledger file in a Cardano node database directory
Variants§
Legacy
Snapshot of a legacy ledger state (before UTxO-HD)
Fields
slot_number: SlotNumber
The ledger file slot number
InMemory
Snapshot of an UTxO-HD in-memory ledger state
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 in_memory(
path: PathBuf,
slot_number: SlotNumber,
folder_name: OsString,
) -> Self
pub fn in_memory( path: PathBuf, slot_number: SlotNumber, folder_name: OsString, ) -> Self
LedgerStateSnapshot::InMemory
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 path 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 · 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
Source§impl Ord for LedgerStateSnapshot
impl Ord for LedgerStateSnapshot
Source§impl PartialEq for LedgerStateSnapshot
impl PartialEq for LedgerStateSnapshot
Source§impl PartialOrd for LedgerStateSnapshot
impl PartialOrd for LedgerStateSnapshot
impl Eq 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 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
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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