pub struct BrowserRuntime { /* private fields */ }Expand description
Implementations§
Source§impl BrowserRuntime
impl BrowserRuntime
Sourcepub const fn new(session: RuntimeSessionId) -> Self
pub const fn new(session: RuntimeSessionId) -> Self
Start a fresh runtime session at generation one.
Sourcepub const fn snapshot(&self) -> RuntimeSnapshot
pub const fn snapshot(&self) -> RuntimeSnapshot
Read the complete immutable status.
Current authority state.
Sourcepub const fn ensure_policy_change_capacity(&self) -> Result<(), RuntimeError>
pub const fn ensure_policy_change_capacity(&self) -> Result<(), RuntimeError>
Whether policy revocation can advance both monotonic counters.
§Errors
Returns RuntimeError::CounterExhausted if either counter is at its
maximum value.
Sourcepub fn policy_changed(&mut self) -> Result<RuntimeSnapshot, RuntimeError>
pub fn policy_changed(&mut self) -> Result<RuntimeSnapshot, RuntimeError>
Revoke prior work after a committed policy change.
§Errors
Returns RuntimeError::CounterExhausted if the generation or event
sequence cannot advance.
Sourcepub fn transition(
&mut self,
next: AuthorityState,
) -> Result<RuntimeSnapshot, RuntimeError>
pub fn transition( &mut self, next: AuthorityState, ) -> Result<RuntimeSnapshot, RuntimeError>
Advance the exact browser authority state machine.
§Errors
Returns RuntimeError::InvalidAuthorityTransition for an edge outside
the required state graph, or RuntimeError::CounterExhausted if the
event sequence cannot advance.
Sourcepub fn admit_event(&mut self) -> Result<RuntimeStamp, RuntimeError>
pub fn admit_event(&mut self) -> Result<RuntimeStamp, RuntimeError>
Record an admitted operation and bind it to this session/generation.
§Errors
Returns RuntimeError::AuthorityNotReady before transport readiness,
RuntimeError::Stopped after terminal shutdown, or
RuntimeError::CounterExhausted if the event sequence cannot advance.
Sourcepub fn admits(&self, stamp: RuntimeStamp) -> bool
pub fn admits(&self, stamp: RuntimeStamp) -> bool
Check that a stamp belongs to current, already-admitted work.