pub struct PssEntry { /* private fields */ }
Expand description
An entry for a single page in the PSS. This type has no concern for the actual type of the page state it stores.
Note: while it is hypothetically possible for this to hold neither a state nor document metadata, that will never happen without user intervention.
Implementations§
source§impl PssEntry
impl PssEntry
sourcepub fn set_state_never(&mut self)
pub fn set_state_never(&mut self)
Declare that this entry will never have state. This should be done by macros that definitively know the structure of a page. This action is revocable under HSR conditions only.
Note that this will not be preserved in freezing (allowing greater flexibility of HSR).
sourcepub fn set_state(
&mut self,
state: Box<dyn AnyFreeze>
) -> Result<(), ClientError>
pub fn set_state( &mut self, state: Box<dyn AnyFreeze> ) -> Result<(), ClientError>
Adds state to this entry. This will return an error if this entry has previously been marked as having no state.
If we’re setting state for HSR, this function’s should be interpreted with caution: if the user has added state to a template/capsule that previously didn’t have state, then nothing in the code will try to set it to never having had state (and there will be nothing in the frozen state for it), which is fine; but, if they removed state from an entity that previously had it, this will return an error to the HSR thaw attempt (which will try to add the old state back). In that case, the error should be discarded by the caller, who should accept the changed data model.