pub struct Epoch(pub u64);
Expand description
Epoch represents a Cardano epoch
Tuple Fields§
§0: u64
Implementations§
source§impl Epoch
impl Epoch
sourcepub const SIGNER_RETRIEVAL_OFFSET: i64 = -1i64
pub const SIGNER_RETRIEVAL_OFFSET: i64 = -1i64
The epoch offset used for signers stake distribution and verification keys retrieval.
sourcepub const NEXT_SIGNER_RETRIEVAL_OFFSET: u64 = 0u64
pub const NEXT_SIGNER_RETRIEVAL_OFFSET: u64 = 0u64
The epoch offset used to retrieve the signers stake distribution and verification keys that’s currently being signed so it can be used in the next epoch.
sourcepub const SIGNER_RECORDING_OFFSET: u64 = 1u64
pub const SIGNER_RECORDING_OFFSET: u64 = 1u64
The epoch offset used for signers stake distribution and verification keys recording.
sourcepub const EPOCH_SETTINGS_RECORDING_OFFSET: u64 = 2u64
pub const EPOCH_SETTINGS_RECORDING_OFFSET: u64 = 2u64
The epoch offset used for aggregator epoch settings recording.
sourcepub const SIGNER_SIGNING_OFFSET: u64 = 2u64
pub const SIGNER_SIGNING_OFFSET: u64 = 2u64
The epoch offset used to retrieve, given the epoch at which a signer registered, the epoch at which the signer can send single signatures.
sourcepub const CARDANO_STAKE_DISTRIBUTION_SNAPSHOT_OFFSET: u64 = 2u64
pub const CARDANO_STAKE_DISTRIBUTION_SNAPSHOT_OFFSET: u64 = 2u64
The epoch offset used to retrieve the epoch at the end of which the snapshot of the stake distribution was taken by the Cardano node and labeled as ‘Mark’ snapshot during the following epoch.
sourcepub fn offset_by(&self, epoch_offset: i64) -> Result<Epoch, EpochError>
pub fn offset_by(&self, epoch_offset: i64) -> Result<Epoch, EpochError>
Computes a new Epoch by applying an epoch offset.
Will fail if the computed epoch is negative.
sourcepub fn offset_to_signer_retrieval_epoch(&self) -> Result<Epoch, EpochError>
pub fn offset_to_signer_retrieval_epoch(&self) -> Result<Epoch, EpochError>
Apply the retrieval offset to this epoch
sourcepub fn offset_to_next_signer_retrieval_epoch(&self) -> Epoch
pub fn offset_to_next_signer_retrieval_epoch(&self) -> Epoch
Apply the next signer retrieval offset to this epoch
sourcepub fn offset_to_recording_epoch(&self) -> Epoch
pub fn offset_to_recording_epoch(&self) -> Epoch
Apply the recording offset to this epoch
sourcepub fn offset_to_epoch_settings_recording_epoch(&self) -> Epoch
pub fn offset_to_epoch_settings_recording_epoch(&self) -> Epoch
Apply the epoch settings recording offset to this epoch
sourcepub fn offset_to_signer_signing_offset(&self) -> Epoch
pub fn offset_to_signer_signing_offset(&self) -> Epoch
Apply the signer signing offset to this epoch
sourcepub fn offset_to_cardano_stake_distribution_snapshot_epoch(&self) -> Epoch
pub fn offset_to_cardano_stake_distribution_snapshot_epoch(&self) -> Epoch
Apply the cardano stake distribution snapshot epoch offset to this epoch
sourcepub fn previous(&self) -> Result<Epoch, EpochError>
pub fn previous(&self) -> Result<Epoch, EpochError>
Computes the previous Epoch
sourcepub fn has_gap_with(&self, other: &Epoch) -> bool
pub fn has_gap_with(&self, other: &Epoch) -> bool
Check if there is a gap with another Epoch.
Trait Implementations§
source§impl AddAssign<&Epoch> for u64
impl AddAssign<&Epoch> for u64
source§fn add_assign(&mut self, rhs: &Epoch)
fn add_assign(&mut self, rhs: &Epoch)
+=
operation. Read moresource§impl AddAssign<&u64> for Epoch
impl AddAssign<&u64> for Epoch
source§fn add_assign(&mut self, rhs: &u64)
fn add_assign(&mut self, rhs: &u64)
+=
operation. Read moresource§impl AddAssign<Epoch> for u64
impl AddAssign<Epoch> for u64
source§fn add_assign(&mut self, rhs: Epoch)
fn add_assign(&mut self, rhs: Epoch)
+=
operation. Read moresource§impl AddAssign<u64> for Epoch
impl AddAssign<u64> for Epoch
source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
+=
operation. Read moresource§impl AddAssign for Epoch
impl AddAssign for Epoch
source§fn add_assign(&mut self, rhs: Epoch)
fn add_assign(&mut self, rhs: Epoch)
+=
operation. Read moresource§impl<'de> Deserialize<'de> for Epoch
impl<'de> Deserialize<'de> for Epoch
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Epoch, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Epoch, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Ord for Epoch
impl Ord for Epoch
source§impl PartialOrd for Epoch
impl PartialOrd for Epoch
source§impl Serialize for Epoch
impl Serialize for Epoch
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
source§impl SubAssign<&Epoch> for u64
impl SubAssign<&Epoch> for u64
source§fn sub_assign(&mut self, rhs: &Epoch)
fn sub_assign(&mut self, rhs: &Epoch)
-=
operation. Read moresource§impl SubAssign<&u64> for Epoch
impl SubAssign<&u64> for Epoch
source§fn sub_assign(&mut self, rhs: &u64)
fn sub_assign(&mut self, rhs: &u64)
-=
operation. Read moresource§impl SubAssign<Epoch> for u64
impl SubAssign<Epoch> for u64
source§fn sub_assign(&mut self, rhs: Epoch)
fn sub_assign(&mut self, rhs: Epoch)
-=
operation. Read moresource§impl SubAssign<u64> for Epoch
impl SubAssign<u64> for Epoch
source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
-=
operation. Read moresource§impl SubAssign for Epoch
impl SubAssign for Epoch
source§fn sub_assign(&mut self, rhs: Epoch)
fn sub_assign(&mut self, rhs: Epoch)
-=
operation. Read moreimpl Beacon for Epoch
impl Copy for Epoch
impl Eq for Epoch
impl StructuralPartialEq for Epoch
Auto Trait Implementations§
impl Freeze for Epoch
impl RefUnwindSafe for Epoch
impl Send for Epoch
impl Sync for Epoch
impl Unpin for Epoch
impl UnwindSafe for Epoch
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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