pub struct Epoch(pub u64);Expand description
Epoch represents a Cardano epoch
Tuple Fields§
§0: u64Implementations§
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 const SIGNER_LEADER_SYNCHRONIZATION_OFFSET: u64 = 0u64
pub const SIGNER_LEADER_SYNCHRONIZATION_OFFSET: u64 = 0u64
The epoch offset used to retrieve the epoch at which a signer has registered to the leader aggregator.
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 offset_to_leader_synchronization_epoch(&self) -> Epoch
pub fn offset_to_leader_synchronization_epoch(&self) -> Epoch
Apply the recording 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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Conv for T
impl<T> Conv for T
§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> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§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> ⓘ
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<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.