pub struct LastUpdate {
pub slot: Slot,
pub stale: bool,
}Expand description
Last update state
Fields§
§slot: SlotLast slot when updated
stale: boolTrue when marked stale, false when slot updated
Implementations§
Source§impl LastUpdate
impl LastUpdate
Sourcepub fn slots_elapsed(&self, slot: Slot) -> Result<u64, ProgramError>
pub fn slots_elapsed(&self, slot: Slot) -> Result<u64, ProgramError>
Return slots elapsed since given slot
Sourcepub fn update_slot(&mut self, slot: Slot)
pub fn update_slot(&mut self, slot: Slot)
Set last update slot
Sourcepub fn mark_stale(&mut self)
pub fn mark_stale(&mut self)
Set stale to true
Trait Implementations§
Source§impl Clone for LastUpdate
impl Clone for LastUpdate
Source§fn clone(&self) -> LastUpdate
fn clone(&self) -> LastUpdate
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 LastUpdate
impl Debug for LastUpdate
Source§impl Default for LastUpdate
impl Default for LastUpdate
Source§fn default() -> LastUpdate
fn default() -> LastUpdate
Returns the “default value” for a type. Read more
Source§impl PartialEq for LastUpdate
impl PartialEq for LastUpdate
Auto Trait Implementations§
impl Freeze for LastUpdate
impl RefUnwindSafe for LastUpdate
impl Send for LastUpdate
impl Sync for LastUpdate
impl Unpin for LastUpdate
impl UnwindSafe for LastUpdate
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> 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 more