#[non_exhaustive]pub struct Epoch {
pub epoch: Option<u64>,
pub committee: Option<ValidatorCommittee>,
pub bcs_system_state: Option<BcsData>,
pub first_checkpoint: Option<u64>,
pub last_checkpoint: Option<u64>,
pub start: Option<Timestamp>,
pub end: Option<Timestamp>,
pub reference_gas_price: Option<u64>,
pub protocol_config: Option<ProtocolConfig>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.epoch: Option<u64>§committee: Option<ValidatorCommittee>The committee governing this epoch.
bcs_system_state: Option<BcsData>Snapshot of IOTA’s SystemState (0x3::iota_system::SystemState) at the
beginning of the epoch, for past epochs, or the current state for the
current epoch.
first_checkpoint: Option<u64>§last_checkpoint: Option<u64>§start: Option<Timestamp>§end: Option<Timestamp>§reference_gas_price: Option<u64>Reference gas price denominated in NANOS
protocol_config: Option<ProtocolConfig>Implementations§
Source§impl Epoch
impl Epoch
pub const EPOCH_FIELD: &'static MessageField
pub const COMMITTEE_FIELD: &'static MessageField
pub const BCS_SYSTEM_STATE_FIELD: &'static MessageField
pub const FIRST_CHECKPOINT_FIELD: &'static MessageField
pub const LAST_CHECKPOINT_FIELD: &'static MessageField
pub const START_FIELD: &'static MessageField
pub const END_FIELD: &'static MessageField
pub const REFERENCE_GAS_PRICE_FIELD: &'static MessageField
pub const PROTOCOL_CONFIG_FIELD: &'static MessageField
Source§impl Epoch
impl Epoch
pub fn path_builder() -> EpochFieldPathBuilder
Source§impl Epoch
impl Epoch
Sourcepub fn with_epoch(self, field: u64) -> Self
pub fn with_epoch(self, field: u64) -> Self
Sets epoch with the provided value.
Sourcepub fn with_committee<T: Into<ValidatorCommittee>>(self, field: T) -> Self
pub fn with_committee<T: Into<ValidatorCommittee>>(self, field: T) -> Self
Sets committee with the provided value.
Sourcepub fn with_bcs_system_state<T: Into<BcsData>>(self, field: T) -> Self
pub fn with_bcs_system_state<T: Into<BcsData>>(self, field: T) -> Self
Sets bcs_system_state with the provided value.
Sourcepub fn with_first_checkpoint(self, field: u64) -> Self
pub fn with_first_checkpoint(self, field: u64) -> Self
Sets first_checkpoint with the provided value.
Sourcepub fn with_last_checkpoint(self, field: u64) -> Self
pub fn with_last_checkpoint(self, field: u64) -> Self
Sets last_checkpoint with the provided value.
Sourcepub fn with_start<T: Into<Timestamp>>(self, field: T) -> Self
pub fn with_start<T: Into<Timestamp>>(self, field: T) -> Self
Sets start with the provided value.
Sourcepub fn with_reference_gas_price(self, field: u64) -> Self
pub fn with_reference_gas_price(self, field: u64) -> Self
Sets reference_gas_price with the provided value.
Sourcepub fn with_protocol_config<T: Into<ProtocolConfig>>(self, field: T) -> Self
pub fn with_protocol_config<T: Into<ProtocolConfig>>(self, field: T) -> Self
Sets protocol_config with the provided value.
Source§impl Epoch
impl Epoch
Sourcepub fn first_checkpoint(&self) -> u64
pub fn first_checkpoint(&self) -> u64
Returns the value of first_checkpoint, or the default value if first_checkpoint is unset.
Sourcepub fn last_checkpoint(&self) -> u64
pub fn last_checkpoint(&self) -> u64
Returns the value of last_checkpoint, or the default value if last_checkpoint is unset.
Sourcepub fn reference_gas_price(&self) -> u64
pub fn reference_gas_price(&self) -> u64
Returns the value of reference_gas_price, or the default value if reference_gas_price is unset.
Source§impl Epoch
impl Epoch
Sourcepub fn epoch_id(&self) -> Result<EpochId, TryFromProtoError>
pub fn epoch_id(&self) -> Result<EpochId, TryFromProtoError>
Get the epoch ID.
Requires epoch in the read_mask.
Sourcepub fn committee(&self) -> Result<ValidatorCommittee, TryFromProtoError>
pub fn committee(&self) -> Result<ValidatorCommittee, TryFromProtoError>
Deserialize the validator committee.
Requires committee in the read_mask.
Sourcepub fn system_state_bcs(&self) -> Result<&[u8], TryFromProtoError>
pub fn system_state_bcs(&self) -> Result<&[u8], TryFromProtoError>
Get the raw BCS-encoded system state bytes.
This is a snapshot of IOTA’s SystemState
(0x3::iota_system::SystemState) at the beginning of the epoch (for
past epochs) or the current state (for the current epoch).
Requires bcs_system_state in the read_mask.
Sourcepub fn first_checkpoint_sequence_number(
&self,
) -> Result<CheckpointSequenceNumber, TryFromProtoError>
pub fn first_checkpoint_sequence_number( &self, ) -> Result<CheckpointSequenceNumber, TryFromProtoError>
Get the first checkpoint sequence number in this epoch.
Requires first_checkpoint in the read_mask.
Sourcepub fn last_checkpoint_sequence_number(
&self,
) -> Result<Option<CheckpointSequenceNumber>, TryFromProtoError>
pub fn last_checkpoint_sequence_number( &self, ) -> Result<Option<CheckpointSequenceNumber>, TryFromProtoError>
Get the last checkpoint sequence number in this epoch.
Returns Ok(None) for the current in-progress epoch (field not yet
set).
Sourcepub fn start_ms(&self) -> Result<CheckpointTimestamp, TryFromProtoError>
pub fn start_ms(&self) -> Result<CheckpointTimestamp, TryFromProtoError>
Get the epoch start time in milliseconds.
Requires start in the read_mask.
Sourcepub fn end_ms(&self) -> Result<Option<CheckpointTimestamp>, TryFromProtoError>
pub fn end_ms(&self) -> Result<Option<CheckpointTimestamp>, TryFromProtoError>
Get the epoch end time in milliseconds.
Returns Ok(None) for the current in-progress epoch (field not yet
set).
Sourcepub fn gas_price(&self) -> Result<u64, TryFromProtoError>
pub fn gas_price(&self) -> Result<u64, TryFromProtoError>
Get the reference gas price in NANOS.
Requires reference_gas_price in the read_mask.
Sourcepub fn protocol_config(&self) -> Result<&ProtocolConfig, TryFromProtoError>
pub fn protocol_config(&self) -> Result<&ProtocolConfig, TryFromProtoError>
Get the protocol configuration for this epoch.
Requires protocol_config in the read_mask.
Trait Implementations§
Source§impl Message for Epoch
impl Message for Epoch
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl MessageFields for Epoch
impl MessageFields 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§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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,
§impl<T> Conv for T
impl<T> Conv for T
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§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> 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.