pub struct EpochResponse {
pub epoch_id: u64,
pub certificate_hash: FixedBytes<32>,
pub certificate_data: CertificateData,
}Expand description
Response containing epoch information and certificate data
The certificate can be returned in two formats based on the encoding
parameter:
- JSON format (
encoding=json):certificatefield contains the full certificate object - BCS format (
encoding=bcs):certificatefield contains the BCS-encoded hex string
Fields§
§epoch_id: u64Epoch ID
certificate_hash: FixedBytes<32>Certificate hash
certificate_data: CertificateDataCertificate data (format depends on encoding parameter)
Implementations§
Source§impl EpochResponse
impl EpochResponse
Sourcepub fn certificate_json(&self) -> Option<&Value>
pub fn certificate_json(&self) -> Option<&Value>
Returns the certificate as JSON when available.
Sourcepub fn certificate_bcs_hex(&self) -> Option<&str>
pub fn certificate_bcs_hex(&self) -> Option<&str>
Returns the certificate as a BCS hex string when available.
Trait Implementations§
Source§impl Clone for EpochResponse
impl Clone for EpochResponse
Source§fn clone(&self) -> EpochResponse
fn clone(&self) -> EpochResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EpochResponse
impl Debug for EpochResponse
Source§impl<'de> Deserialize<'de> for EpochResponse
impl<'de> Deserialize<'de> for EpochResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EpochResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EpochResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EpochResponse
impl Display for EpochResponse
Source§impl Serialize for EpochResponse
impl Serialize for EpochResponse
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,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for EpochResponse
impl RefUnwindSafe for EpochResponse
impl Send for EpochResponse
impl Sync for EpochResponse
impl Unpin for EpochResponse
impl UnwindSafe for EpochResponse
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 moreSource§impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.