pub struct StewardLicenceClient { /* private fields */ }Expand description
LicenceClient bound to the store’s binding in effect.
Implementations§
Source§impl StewardLicenceClient
impl StewardLicenceClient
Sourcepub fn new(
store: Arc<CheckoutGrantStore>,
key: SigningKey,
node_id: impl Into<String>,
transport: Arc<dyn LicenceTransport>,
clock: ClockMs,
) -> Arc<Self> ⓘ
pub fn new( store: Arc<CheckoutGrantStore>, key: SigningKey, node_id: impl Into<String>, transport: Arc<dyn LicenceTransport>, clock: ClockMs, ) -> Arc<Self> ⓘ
A client for this node (node_id, signing with key) over transport.
Sourcepub fn steward_binding(&self) -> Result<BindingRecord, LicenceClientError>
pub fn steward_binding(&self) -> Result<BindingRecord, LicenceClientError>
The binding in effect when it names this node and key as its steward.
Trait Implementations§
Source§impl LicenceClient for StewardLicenceClient
impl LicenceClient for StewardLicenceClient
Source§fn checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 CheckoutWire,
) -> Pin<Box<dyn Future<Output = Result<SignedGrant, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn checkout<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 CheckoutWire,
) -> Pin<Box<dyn Future<Output = Result<SignedGrant, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
POST /licence/v1/checkout: the signed grant, with seq persisted
by the Seed before release.Source§fn artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
blake3_hex: &'life1 str,
max_len: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
blake3_hex: &'life1 str,
max_len: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
GET /licence/v1/artifact/<blake3>: the cached binary. At most
max_len bytes are accepted.Source§fn grants_since<'life0, 'async_trait>(
&'life0 self,
since: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<SignedGrant>, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn grants_since<'life0, 'async_trait>(
&'life0 self,
since: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<SignedGrant>, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
GET /licence/v1/grants?since=<seq>: renewal batch.Source§fn grants_page<'life0, 'async_trait>(
&'life0 self,
since: u64,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn grants_page<'life0, 'async_trait>(
&'life0 self,
since: u64,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Self::grants_since with the paging cursor.Source§fn renew<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn renew<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
POST /licence/v1/renew: a new grant (or a withdrawal) for every
active checkout, at most one batch. next is the Seed’s issue counter
after the renewal (the bound for the catch-up cursor).Source§fn release<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cog_id: &'life1 str,
version: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn release<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cog_id: &'life1 str,
version: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<GrantsPage, LicenceClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
POST /licence/v1/renew with {"release": [{cog_id, version}]}: the
Seed withdraws that checkout (a renewal whose expires_at <= issued_at) and, as for any renewal, renews every other active one.Auto Trait Implementations§
impl !RefUnwindSafe for StewardLicenceClient
impl !UnwindSafe for StewardLicenceClient
impl Freeze for StewardLicenceClient
impl Send for StewardLicenceClient
impl Sync for StewardLicenceClient
impl Unpin for StewardLicenceClient
impl UnsafeUnpin for StewardLicenceClient
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
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> ⓘ
Converts
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> ⓘ
Converts
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