pub struct ServerSnapshot { /* private fields */ }Expand description
Inert server-state bytes supplied by a trusted SnapshotStore.
This type has no conversion to operational ratchet state. Activation is available only through
PersistentServer::restore, which validates the canonical encoding and wins a store CAS first.
The envelope digest is an exact-byte identity for CAS and parent links, not an authenticator.
Implementations§
Source§impl ServerSnapshot
impl ServerSnapshot
pub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn head(&self) -> Result<SnapshotHead, PersistenceError>
Sourcepub fn validate_successor(
&self,
expected: Option<&SnapshotHead>,
) -> Result<SnapshotHead, PersistenceError>
pub fn validate_successor( &self, expected: Option<&SnapshotHead>, ) -> Result<SnapshotHead, PersistenceError>
Validate the envelope’s lineage, next generation and exact parent digest before a store CAS.
This does not authenticate bytes, decode the payload, establish freshness or make a store atomic.
The store must compare expected with its trusted current head under the same transaction.
Auto Trait Implementations§
impl Forget for ServerSnapshot
impl Freeze for ServerSnapshot
impl Move for ServerSnapshot
impl RefUnwindSafe for ServerSnapshot
impl Send for ServerSnapshotwhere
RawVecInner: Send,
impl Sync for ServerSnapshotwhere
RawVecInner: Sync,
impl Unpin for ServerSnapshot
impl UnsafeUnpin for ServerSnapshot
impl UnwindSafe for ServerSnapshotwhere
RawVecInner: UnwindSafe,
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