pub struct Manifest {Show 14 fields
pub version: u32,
pub generation: u64,
pub snapshot: Option<String>,
pub snapshot_checksum: Option<String>,
pub current_salt_1: u32,
pub current_salt_2: u32,
pub page_size: u32,
pub shipped_frames: u32,
pub db_size: u64,
pub last_updated: String,
pub etag: Option<String>,
pub l1_files: Vec<L1File>,
pub l1_max_frame: Option<u32>,
pub segment_checksums: HashMap<String, String>,
}Fields§
§version: u32§generation: u64§snapshot: Option<String>§snapshot_checksum: Option<String>§current_salt_1: u32§current_salt_2: u32§page_size: u32§shipped_frames: u32§db_size: u64§last_updated: String§etag: Option<String>ETag of the manifest object in the bucket. Used for conditional writes. None means the manifest doesn’t exist yet (fresh start) or we don’t know the etag.
l1_files: Vec<L1File>Compacted L1 files. These merge multiple L0 segments into fewer, larger files for efficient restore. L0 segments covered by an L1 file can be safely deleted by GC.
l1_max_frame: Option<u32>The highest frame covered by any L1 file. L0 segments with end_frame <= this value are candidates for GC after compaction.
segment_checksums: HashMap<String, String>SHA256 checksums of L0 segment files, keyed by object key. Used during restore to verify segment integrity before replay. Empty for backward compatibility with existing manifests.
Implementations§
Source§impl Manifest
impl Manifest
pub fn new(salt_1: u32, salt_2: u32, page_size: u32) -> Self
pub fn update_snapshot( &mut self, snapshot_path: String, checksum: String, salt_1: u32, salt_2: u32, page_size: u32, db_size: u64, )
pub fn update_shipped_frames(&mut self, frames: u32)
pub fn conflict_level(&self, remote: &Manifest) -> ConflictLevel
pub fn check_conflict(&self, remote: &Manifest) -> bool
pub fn salt_string(&self) -> String
pub fn is_different_salt(&self, salt_1: u32, salt_2: u32) -> bool
pub fn segment_prefix(&self) -> String
Sourcepub fn l1_max_frame_value(&self) -> u32
pub fn l1_max_frame_value(&self) -> u32
Returns the highest frame covered by any L1 file, or 0 if no L1 files exist. L0 segments with end_frame <= this value are fully covered by compaction and can be safely deleted by GC.
Sourcepub fn add_l1_file(&mut self, l1: L1File)
pub fn add_l1_file(&mut self, l1: L1File)
Add an L1 file to the manifest and update l1_max_frame.
Sourcepub fn set_etag(&mut self, etag: String)
pub fn set_etag(&mut self, etag: String)
Update the ETag after reading it from the bucket (e.g. from GET response headers).
Sourcepub fn set_last_updated_str(&mut self, ts: &str)
pub fn set_last_updated_str(&mut self, ts: &str)
Set last_updated from an RFC3339 string. For test use. Panics if the string is not valid RFC3339.
Sourcepub fn with_last_updated(
salt_1: u32,
salt_2: u32,
page_size: u32,
ts: &str,
) -> Self
pub fn with_last_updated( salt_1: u32, salt_2: u32, page_size: u32, ts: &str, ) -> Self
Create a manifest with a specific last_updated timestamp. For test use. Panics if the string is not valid RFC3339.
pub fn serialize(&self) -> Result<Vec<u8>>
pub fn deserialize(data: &[u8]) -> Result<Self>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
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>,
Auto Trait Implementations§
impl Forget for Manifest
impl Freeze for Manifest
impl Move for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnsafeUnpin for Manifest
impl UnwindSafe for Manifest
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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