pub struct HostAdmission { /* private fields */ }Expand description
Aggregate admission owner for one host process.
Implementations§
Source§impl HostAdmission
impl HostAdmission
Sourcepub const fn host_bytes(&self) -> u64
pub const fn host_bytes(&self) -> u64
HostAdmission::host_bytes.
Sourcepub fn remaining_host_bytes(&self) -> u64
pub fn remaining_host_bytes(&self) -> u64
HostAdmission::remaining_host_bytes.
Sourcepub fn profile_for_bytes(bytes: u64) -> Result<CellProfile, QdnfError>
pub fn profile_for_bytes(bytes: u64) -> Result<CellProfile, QdnfError>
HostAdmission::profile_for_bytes.
Sourcepub fn admit_cell(
&mut self,
profile: CellProfile,
bytes: u64,
) -> Result<CellSlot, QdnfError>
pub fn admit_cell( &mut self, profile: CellProfile, bytes: u64, ) -> Result<CellSlot, QdnfError>
Admit one cell against the shared host ledger.
Sourcepub fn occupied_cells(&self) -> usize
pub fn occupied_cells(&self) -> usize
HostAdmission::occupied_cells.
Sourcepub fn charge(
&mut self,
identity: StrongDigest,
add: ResourceBudget,
verified_peer: bool,
) -> Result<ReservationHandle, QdnfError>
pub fn charge( &mut self, identity: StrongDigest, add: ResourceBudget, verified_peer: bool, ) -> Result<ReservationHandle, QdnfError>
Charge work for a peer identity. The identity is recorded; it does not receive an independent host cap.
Sourcepub fn release_charge(
&mut self,
handle: ReservationHandle,
) -> Result<(), QdnfError>
pub fn release_charge( &mut self, handle: ReservationHandle, ) -> Result<(), QdnfError>
Releases a charge reservation.
Sourcepub const fn tracked_identities(&self) -> u8
pub const fn tracked_identities(&self) -> u8
HostAdmission::tracked_identities.
Auto Trait Implementations§
impl Freeze for HostAdmission
impl RefUnwindSafe for HostAdmission
impl Send for HostAdmission
impl Sync for HostAdmission
impl Unpin for HostAdmission
impl UnsafeUnpin for HostAdmission
impl UnwindSafe for HostAdmission
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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