pub struct DelegationHorizon { /* private fields */ }Expand description
The signing horizon h = e − Δ of a node’s own delegation.
Implementations§
Source§impl DelegationHorizon
impl DelegationHorizon
Sourcepub fn of(delegation: &Delegation) -> Self
pub fn of(delegation: &Delegation) -> Self
The horizon of delegation.
Sourcepub const fn expiring_at(expires_at_ms: u128) -> Self
pub const fn expiring_at(expires_at_ms: u128) -> Self
The horizon of a delegation that expires at expires_at_ms.
Sourcepub const fn expires_at_ms(self) -> u128
pub const fn expires_at_ms(self) -> u128
The delegation’s expiry e.
Sourcepub const fn horizon_ms(self) -> u128
pub const fn horizon_ms(self) -> u128
h: the first instant at which the node can send nothing.
Sourcepub const fn signs_at(self, now_ms: u128) -> bool
pub const fn signs_at(self, now_ms: u128) -> bool
Whether the node can still send at now_ms: now < h.
Sourcepub const fn admitted_at(self, now_ms: u128) -> Result<()>
pub const fn admitted_at(self, now_ms: u128) -> Result<()>
A process may start at now_ms only while it can still send: a delegation with less
than Δ left would make it mute from its first frame.
§Errors
Error::DelegationHorizonReached at or past the horizon.
Sourcepub const fn state_at(self, now_ms: u128) -> SigningState
pub const fn state_at(self, now_ms: u128) -> SigningState
The state at now_ms (module diagram). Law: state_at(t) = Mute ⇔ ¬signs_at(t), and the
state never goes back along the diagram as t grows.
Sourcepub const fn renew_at_ms(self, created_at_ms: u128) -> u128
pub const fn renew_at_ms(self, created_at_ms: u128) -> u128
The earliest instant at which in-process renewal is due for a delegation stamped at
created_at_ms: max(h − lead, c + ⌊(h − c) / 2⌋).
Law (Renewal instant): For every delegation with c < h, renew_at_ms(c) ∈ [c, h),
and when h − c ≥ 2, renew_at_ms(c) > c so minting a replacement with the same TTL at
t ≥ renew_at_ms(c) strictly advances the horizon (h' > h).
Trait Implementations§
Source§impl Clone for DelegationHorizon
impl Clone for DelegationHorizon
impl Copy for DelegationHorizon
Source§impl Debug for DelegationHorizon
impl Debug for DelegationHorizon
impl Eq for DelegationHorizon
Source§impl PartialEq for DelegationHorizon
impl PartialEq for DelegationHorizon
impl StructuralPartialEq for DelegationHorizon
Auto Trait Implementations§
impl Forget for DelegationHorizon
impl Freeze for DelegationHorizon
impl Move for DelegationHorizon
impl RefUnwindSafe for DelegationHorizon
impl Send for DelegationHorizon
impl Sync for DelegationHorizon
impl Unpin for DelegationHorizon
impl UnsafeUnpin for DelegationHorizon
impl UnwindSafe for DelegationHorizon
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
impl<T> MaybeSendSync for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.