pub struct StatementIssuer { /* private fields */ }Expand description
A client’s statement issuer, shared by every link of one node.
Implementations§
Source§impl StatementIssuer
impl StatementIssuer
Sourcepub fn new(
identity: Arc<NodeKey>,
clock: Clock,
) -> Result<StatementIssuer, IssuerError>
pub fn new( identity: Arc<NodeKey>, clock: Clock, ) -> Result<StatementIssuer, IssuerError>
An issuer for identity, reading the time from clock. It starts with
a new CONNECT key, bound and stated.
Sourcepub fn with_wall_clock(
identity: Arc<NodeKey>,
) -> Result<StatementIssuer, IssuerError>
pub fn with_wall_clock( identity: Arc<NodeKey>, ) -> Result<StatementIssuer, IssuerError>
An issuer on the wall clock.
Sourcepub fn connect_material(&self) -> Result<ConnectMaterial, IssuerError>
pub fn connect_material(&self) -> Result<ConnectMaterial, IssuerError>
The current CONNECT key with its binding and a statement for it, both in force at the clock’s time. Work that is due is done first.
Sourcepub fn rotation_failures(&self) -> u64
pub fn rotation_failures(&self) -> u64
How many rotations have failed since the last that succeeded.
Sourcepub fn subscribe(
&self,
binding: &SignedTbs,
) -> Result<StatementSubscription, IssuerError>
pub fn subscribe( &self, binding: &SignedTbs, ) -> Result<StatementSubscription, IssuerError>
Hands over the newest statement for binding at every reissue. The
subscription closes once a tick finds the binding’s not_after passed,
and unsubscribes when dropped.
Sourcepub fn tick(&self) -> Result<(), IssuerError>
pub fn tick(&self) -> Result<(), IssuerError>
The periodic work at the clock’s time: a statement for each binding in force, a rotation when one is due, and the expired bindings let go.
Sourcepub fn spawn_ticks(
&self,
on_error: impl Fn(IssuerError) + Send + 'static,
) -> JoinHandle<()> ⓘ
pub fn spawn_ticks( &self, on_error: impl Fn(IssuerError) + Send + 'static, ) -> JoinHandle<()> ⓘ
Ticks every 15 minutes until every handle to the issuer is dropped,
handing a failed tick’s error to on_error.