pub struct ParentAnchor { /* private fields */ }Expand description
The Parent anchor backend.
Implementations§
Source§impl ParentAnchor
impl ParentAnchor
Sourcepub fn new(
chain: Arc<ChainManager>,
key: SigningKey,
project_id: impl Into<String>,
cert_serial: u64,
transport: Arc<dyn ParentTransport>,
pending_path: impl Into<PathBuf>,
cfg: ParentAnchorConfig,
) -> Self
pub fn new( chain: Arc<ChainManager>, key: SigningKey, project_id: impl Into<String>, cert_serial: u64, transport: Arc<dyn ParentTransport>, pending_path: impl Into<PathBuf>, cfg: ParentAnchorConfig, ) -> Self
Build over the project chain. Recovers the last accepted statement
(signed by the current key) from the chain and drops a pending
statement that is already covered.
Sourcepub fn set_cert_serial(&self, serial: u64)
pub fn set_cert_serial(&self, serial: u64)
The certificate serial put into new statements (after a rekey).
Sourcepub fn last_accepted(&self) -> Option<(u64, String)>
pub fn last_accepted(&self) -> Option<(u64, String)>
(seq, statement hash) of the last accepted statement.
Sourcepub fn pending(&self) -> Option<ProjectAnchorStmt>
pub fn pending(&self) -> Option<ProjectAnchorStmt>
The statement waiting for the parent, if any.
Sourcepub fn last_error(&self) -> Option<String>
pub fn last_error(&self) -> Option<String>
Message of the most recent failed attempt, cleared on success.
Sourcepub fn anchor_head_at(
&self,
now: DateTime<Utc>,
force: bool,
) -> Result<AnchorReceipt, String>
pub fn anchor_head_at( &self, now: DateTime<Utc>, force: bool, ) -> Result<AnchorReceipt, String>
Anchor the current head now, ignoring the frequency policy but not
the retry backoff unless force (graceful shutdown passes true).
Sourcepub fn anchor_head(&self) -> Result<AnchorReceipt, String>
pub fn anchor_head(&self) -> Result<AnchorReceipt, String>
Self::anchor_head_at for the wall clock, forced: the shutdown
anchor. Bounded by the submission deadline.
Sourcepub fn retry_pending_at(
&self,
now: DateTime<Utc>,
) -> Result<Option<AnchorReceipt>, String>
pub fn retry_pending_at( &self, now: DateTime<Utc>, ) -> Result<Option<AnchorReceipt>, String>
Resend the latest pending statement exactly as written once its
backoff has elapsed. Ok(None): nothing pending, or not due yet.
Sourcepub fn retry_pending(&self) -> Result<Option<AnchorReceipt>, String>
pub fn retry_pending(&self) -> Result<Option<AnchorReceipt>, String>
Self::retry_pending_at for the wall clock.
Trait Implementations§
Source§impl ChainAnchor for ParentAnchor
impl ChainAnchor for ParentAnchor
Source§fn anchor(&self, hash: &[u8; 32]) -> Result<AnchorReceipt, String>
fn anchor(&self, hash: &[u8; 32]) -> Result<AnchorReceipt, String>
Source§fn verify(&self, receipt: &AnchorReceipt) -> Result<bool, String>
fn verify(&self, receipt: &AnchorReceipt) -> Result<bool, String>
Source§fn backend_name(&self) -> &str
fn backend_name(&self) -> &str
Auto Trait Implementations§
impl !Freeze for ParentAnchor
impl !RefUnwindSafe for ParentAnchor
impl !UnwindSafe for ParentAnchor
impl Send for ParentAnchor
impl Sync for ParentAnchor
impl Unpin for ParentAnchor
impl UnsafeUnpin for ParentAnchor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more