pub struct LicenceExchange { /* private fields */ }Expand description
Receives, applies, forwards and syncs the licence records of one node.
Implementations§
Source§impl LicenceExchange
impl LicenceExchange
Sourcepub fn start(p: LicenceExchangeParts) -> Arc<Self> ⓘ
pub fn start(p: LicenceExchangeParts) -> Arc<Self> ⓘ
Start the exchange: install the control sinks on the mesh (the kernel runtime or the service links) and begin the periodic and on-connect catch-up sync (when inside a tokio runtime).
Sourcepub fn approvals(&self) -> &Arc<ApprovalStore> ⓘ
pub fn approvals(&self) -> &Arc<ApprovalStore> ⓘ
The node’s approval store (the run gate and weaver cog checkout status read it).
Sourcepub fn accept_binding(
&self,
env: &SignedBinding,
spend: Spend,
) -> Result<Receipt, ExchangeError>
pub fn accept_binding( &self, env: &SignedBinding, spend: Spend, ) -> Result<Receipt, ExchangeError>
Cheap pre-verify filter and apply for a binding. spend picks
the bucket (the operator’s own issue); see Spend.
Sourcepub fn accept_grant(
&self,
env: &SignedGrant,
spend: Spend,
) -> Result<Receipt, ExchangeError>
pub fn accept_grant( &self, env: &SignedGrant, spend: Spend, ) -> Result<Receipt, ExchangeError>
Cheap pre-verify filter and apply for a grant.
Sourcepub fn accept_approval(
&self,
env: &SignedApproval,
spend: Spend,
) -> Result<Receipt, ExchangeError>
pub fn accept_approval( &self, env: &SignedApproval, spend: Spend, ) -> Result<Receipt, ExchangeError>
Cheap pre-verify filter and apply for an approval.
Sourcepub async fn issue_binding(
&self,
env: SignedBinding,
) -> Result<Receipt, ExchangeError>
pub async fn issue_binding( &self, env: SignedBinding, ) -> Result<Receipt, ExchangeError>
Accept a binding here (the operator’s own node, not rate limited) and send it to every peer. Used for a bind and for an unbind: any node with an operator key may issue one, so a steward cannot block it.
Sourcepub async fn issue_grant(
&self,
env: SignedGrant,
) -> Result<Receipt, ExchangeError>
pub async fn issue_grant( &self, env: SignedGrant, ) -> Result<Receipt, ExchangeError>
As Self::issue_binding for a grant.
Sourcepub async fn issue_approval(
&self,
env: SignedApproval,
) -> Result<Receipt, ExchangeError>
pub async fn issue_approval( &self, env: SignedApproval, ) -> Result<Receipt, ExchangeError>
As Self::issue_binding for an approval.
Source§impl LicenceExchange
impl LicenceExchange
Sourcepub async fn sync_peer(&self, peer: &str)
pub async fn sync_peer(&self, peer: &str)
Ask peer for its licence records. Does nothing while the local mesh
id is unset, the peer is banned, or a request to it is still open.
Sourcepub async fn resync_all(&self)
pub async fn resync_all(&self)
Forget the requests in flight and ask every connected peer afresh: a node that just (re)gained the licence role, whose earlier requests the service refused, catches up at once.
Sourcepub async fn sync_all(&self)
pub async fn sync_all(&self)
Self::sync_peer with every connected peer.
Trait Implementations§
Source§impl GrantFlood for LicenceExchange
The steward relay floods the grants it obtains through the exchange
(ADR-106 phase 1b over the 1c relay): same topic, budgets and admission
as any other grant flood.
impl GrantFlood for LicenceExchange
The steward relay floods the grants it obtains through the exchange (ADR-106 phase 1b over the 1c relay): same topic, budgets and admission as any other grant flood.
Source§fn flood<'life0, 'life1, 'async_trait>(
&'life0 self,
grant: &'life1 SignedGrant,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn flood<'life0, 'life1, 'async_trait>(
&'life0 self,
grant: &'life1 SignedGrant,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
grant to the admitted peers. Best effort: the requester also
gets the grant in its reply, and sync catches the rest up.Auto Trait Implementations§
impl !Freeze for LicenceExchange
impl !RefUnwindSafe for LicenceExchange
impl !UnwindSafe for LicenceExchange
impl Send for LicenceExchange
impl Sync for LicenceExchange
impl Unpin for LicenceExchange
impl UnsafeUnpin for LicenceExchange
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