pub struct SnapshotRequest {
pub compressed: bool,
pub max_page_size: u32,
pub is_fresh_node: bool,
}Expand description
Request to initiate a full snapshot transfer.
CRITICAL: This is ONLY for fresh nodes with NO existing state. Invariant I5: Initialized nodes MUST use CRDT merge, not snapshot overwrite.
Fields§
§compressed: boolWhether to compress the snapshot data.
max_page_size: u32Maximum page size in bytes (0 = use responder’s default).
is_fresh_node: boolWhether the initiator is definitely a fresh node (for safety check). If false, responder SHOULD verify this claim.
Implementations§
Source§impl SnapshotRequest
impl SnapshotRequest
Sourcepub fn compressed() -> Self
pub fn compressed() -> Self
Create a request for compressed snapshot.
Sourcepub fn uncompressed() -> Self
pub fn uncompressed() -> Self
Create a request for uncompressed snapshot.
Sourcepub fn with_max_page_size(self, size: u32) -> Self
pub fn with_max_page_size(self, size: u32) -> Self
Set maximum page size.
Sourcepub fn validated_page_size(&self) -> u32
pub fn validated_page_size(&self) -> u32
Get the validated page size.
Returns DEFAULT_SNAPSHOT_PAGE_SIZE if 0, otherwise clamps to MAX.
Trait Implementations§
Source§impl BorshDeserialize for SnapshotRequest
impl BorshDeserialize for SnapshotRequest
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for SnapshotRequest
impl BorshSerialize for SnapshotRequest
Source§impl Clone for SnapshotRequest
impl Clone for SnapshotRequest
Source§fn clone(&self) -> SnapshotRequest
fn clone(&self) -> SnapshotRequest
Returns a duplicate of the value. Read more
1.0.0 · 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 SnapshotRequest
impl Debug for SnapshotRequest
Source§impl PartialEq for SnapshotRequest
impl PartialEq for SnapshotRequest
impl StructuralPartialEq for SnapshotRequest
Auto Trait Implementations§
impl Freeze for SnapshotRequest
impl RefUnwindSafe for SnapshotRequest
impl Send for SnapshotRequest
impl Sync for SnapshotRequest
impl Unpin for SnapshotRequest
impl UnsafeUnpin for SnapshotRequest
impl UnwindSafe for SnapshotRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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