#[repr(C)]pub struct Clock {
pub slot: u64,
pub epoch_start_timestamp: i64,
pub epoch: u64,
pub leader_schedule_epoch: u64,
pub unix_timestamp: i64,
}Expand description
A representation of network time.
All members of Clock start from 0 upon network boot.
Fields§
§slot: u64The current Slot.
epoch_start_timestamp: i64The timestamp of the first Slot in this Epoch.
epoch: u64The current Epoch.
leader_schedule_epoch: u64The future Epoch for which the leader schedule has
most recently been calculated.
unix_timestamp: i64The approximate real world time of the current slot.
This value was originally computed from genesis creation time and
network time in slots, incurring a lot of drift. Following activation of
the timestamp_correction and timestamp_bounding features it
is calculated using a validator timestamp oracle.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Clock
impl<'de> Deserialize<'de> for Clock
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Clock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Clock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Clock
Source§impl<'de, __WincodeConfig> SchemaRead<'de, __WincodeConfig> for Clockwhere
__WincodeConfig: Config,
impl<'de, __WincodeConfig> SchemaRead<'de, __WincodeConfig> for Clockwhere
__WincodeConfig: Config,
Source§impl<__WincodeConfig> SchemaWrite<__WincodeConfig> for Clockwhere
__WincodeConfig: Config,
impl<__WincodeConfig> SchemaWrite<__WincodeConfig> for Clockwhere
__WincodeConfig: Config,
type Src = Clock
Source§fn size_of(
src: &<Clock as SchemaWrite<__WincodeConfig>>::Src,
) -> Result<usize, WriteError>
fn size_of( src: &<Clock as SchemaWrite<__WincodeConfig>>::Src, ) -> Result<usize, WriteError>
Get the serialized size of
Self::Src. Read moreSource§fn write(
writer: impl Writer,
src: &<Clock as SchemaWrite<__WincodeConfig>>::Src,
) -> Result<(), WriteError>
fn write( writer: impl Writer, src: &<Clock as SchemaWrite<__WincodeConfig>>::Src, ) -> Result<(), WriteError>
Write
Self::Src to writer.Source§impl Serialize for Clock
impl Serialize for Clock
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
impl StructuralPartialEq for Clock
Source§impl SysvarSerialize for Clock
Available on crate feature bincode only.
impl SysvarSerialize for Clock
Available on crate feature
bincode only.Source§fn from_account_info(
account_info: &AccountInfo<'_>,
) -> Result<Self, ProgramError>
fn from_account_info( account_info: &AccountInfo<'_>, ) -> Result<Self, ProgramError>
Deserializes the sysvar from its
AccountInfo. Read moreSource§fn to_account_info(&self, account_info: &mut AccountInfo<'_>) -> Option<()>
fn to_account_info(&self, account_info: &mut AccountInfo<'_>) -> Option<()>
Serializes the sysvar to
AccountInfo. Read moreSource§impl<__WincodeConfig> ZeroCopy<__WincodeConfig> for Clockwhere
__WincodeConfig: Config,
u64: for<'_wincode_internal> ZeroCopy<__WincodeConfig> + for<'_wincode_internal> ZeroCopy<__WincodeConfig> + for<'_wincode_internal> ZeroCopy<__WincodeConfig>,
i64: for<'_wincode_internal> ZeroCopy<__WincodeConfig> + for<'_wincode_internal> ZeroCopy<__WincodeConfig>,
__WincodeAssert<solana_clock::::_#4::{impl#1}::{constant#0}>: for<'_wincode_internal> __WincodeIsTrue,
impl<__WincodeConfig> ZeroCopy<__WincodeConfig> for Clockwhere
__WincodeConfig: Config,
u64: for<'_wincode_internal> ZeroCopy<__WincodeConfig> + for<'_wincode_internal> ZeroCopy<__WincodeConfig> + for<'_wincode_internal> ZeroCopy<__WincodeConfig>,
i64: for<'_wincode_internal> ZeroCopy<__WincodeConfig> + for<'_wincode_internal> ZeroCopy<__WincodeConfig>,
__WincodeAssert<solana_clock::::_#4::{impl#1}::{constant#0}>: for<'_wincode_internal> __WincodeIsTrue,
Source§fn from_bytes<'de>(bytes: &'de [u8], config: C) -> Result<&'de Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
fn from_bytes<'de>(bytes: &'de [u8], config: C) -> Result<&'de Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
Like
crate::ZeroCopy::from_bytes, but allows the caller to provide a custom configuration.Source§fn from_bytes_mut<'de>(
bytes: &'de mut [u8],
config: C,
) -> Result<&'de mut Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
fn from_bytes_mut<'de>(
bytes: &'de mut [u8],
config: C,
) -> Result<&'de mut Self, ReadError>where
Self: Sized + SchemaRead<'de, C, Dst = Self>,
Like
crate::ZeroCopy::from_bytes_mut, but allows the caller to provide a custom configuration.Auto Trait Implementations§
impl Freeze for Clock
impl RefUnwindSafe for Clock
impl Send for Clock
impl Sync for Clock
impl Unpin for Clock
impl UnsafeUnpin for Clock
impl UnwindSafe for Clock
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<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
Source§impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
Source§impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given
Reader into dst.impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
Source§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given
Reader into a new Self::Dst.Source§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given
Reader into dst.impl<T, C> SchemaReadOwned<C> for Twhere
C: ConfigCore,
T: for<'de> SchemaRead<'de, C>,
Source§impl<T> Serialize for T
impl<T> Serialize for T
Source§fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
Available on crate feature
alloc only.Serialize a serializable type into a
Vec of bytes.Source§fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
Serialize a serializable type into the given byte buffer.
Source§fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.
Source§impl<T, C> Serialize<C> for T
impl<T, C> Serialize<C> for T
Source§fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
Available on crate feature
alloc only.Serialize a serializable type into a
Vec of bytes.Source§fn serialize_into(
dst: impl Writer,
src: &Self::Src,
config: C,
) -> Result<(), WriteError>
fn serialize_into( dst: impl Writer, src: &Self::Src, config: C, ) -> Result<(), WriteError>
Serialize a serializable type into the given
Writer.Source§fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.