pub struct State { /* private fields */ }Expand description
The complete private state of one transaction.
Implementations§
Source§impl State
impl State
Sourcepub fn new(txid: impl Into<TxId>) -> Self
pub fn new(txid: impl Into<TxId>) -> Self
Birth with no chain claim or stored evidence, as in Tracker.State.init.
Sourcepub fn evidence(&self) -> Option<&CheckedProof>
pub fn evidence(&self) -> Option<&CheckedProof>
The retained record, including when the word has become stale.
Sourcepub fn suspect(&self) -> bool
pub fn suspect(&self) -> bool
Whether an unresolved fork requires a header recheck before acting.
Sourcepub fn last_hint_at(&self) -> Option<Timestamp>
pub fn last_hint_at(&self) -> Option<Timestamp>
Time of the most recently received hint, even for out of order clocks.
Sourcepub fn reask(&self) -> Option<&Reask>
pub fn reask(&self) -> Option<&Reask>
The next re-ask, which the host must execute and feed back.
Sourcepub fn step<H: Headers + ?Sized>(
&mut self,
params: &Params,
headers: &H,
input: Input,
) -> Result<(), CheckError>
pub fn step<H: Headers + ?Sized>( &mut self, params: &Params, headers: &H, input: Input, ) -> Result<(), CheckError>
Execute one Lean transition. Proof and header failures retain the word and record the re-ask before returning an error to the host.
§Errors
The CheckError of a proof, competitor, chain event or recheck whose
check fails; the word is kept and the re-ask recorded.
Trait Implementations§
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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