pub struct ContextSnapshot { /* private fields */ }Expand description
Durable, verified context snapshot for storage adapters.
This is the supported rehydration boundary for embedders such as Helms.
Storage persists this value and later calls ContextState::from_snapshot.
It must not reconstruct facts through promotion constructors.
Implementations§
Source§impl ContextSnapshot
impl ContextSnapshot
Sourcepub fn from_context(context: &ContextState) -> ContextSnapshot
pub fn from_context(context: &ContextState) -> ContextSnapshot
Build a storage snapshot from a live context.
Sourcepub fn merkle_root(&self) -> &MerkleRoot
pub fn merkle_root(&self) -> &MerkleRoot
Returns the snapshot Merkle root.
Sourcepub fn facts(&self) -> &BTreeMap<ContextKey, Vec<ContextFact>>
pub fn facts(&self) -> &BTreeMap<ContextKey, Vec<ContextFact>>
Returns fact projections grouped by context key.
Sourcepub fn proposals(&self) -> &BTreeMap<ContextKey, Vec<ProposedFact>>
pub fn proposals(&self) -> &BTreeMap<ContextKey, Vec<ProposedFact>>
Returns staged proposals grouped by context key.
Trait Implementations§
Source§impl Clone for ContextSnapshot
impl Clone for ContextSnapshot
Source§fn clone(&self) -> ContextSnapshot
fn clone(&self) -> ContextSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ContextSnapshot
impl Debug for ContextSnapshot
Source§impl Serialize for ContextSnapshot
impl Serialize for ContextSnapshot
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ContextSnapshot
impl !RefUnwindSafe for ContextSnapshot
impl Send for ContextSnapshot
impl Sync for ContextSnapshot
impl Unpin for ContextSnapshot
impl UnsafeUnpin for ContextSnapshot
impl !UnwindSafe for ContextSnapshot
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