Struct jormungandr_lib::interfaces::LeadershipLog
source · pub struct LeadershipLog {
created_at_time: SystemTime,
scheduled_at_time: SystemTime,
scheduled_at_date: BlockDate,
wake_at_time: Option<SystemTime>,
finished_at_time: Option<SystemTime>,
status: LeadershipLogStatus,
}
Expand description
provides information regarding events in the leadership schedule
Fields§
§created_at_time: SystemTime
§scheduled_at_time: SystemTime
§scheduled_at_date: BlockDate
§wake_at_time: Option<SystemTime>
§finished_at_time: Option<SystemTime>
§status: LeadershipLogStatus
Implementations§
source§impl LeadershipLog
impl LeadershipLog
pub fn new(scheduled_at_date: BlockDate, scheduled_at_time: SystemTime) -> Self
sourcepub fn leadership_log_id(&self) -> LeadershipLogId
pub fn leadership_log_id(&self) -> LeadershipLogId
retrieve a unique identifier to this log
pub fn created_at_time(&self) -> &SystemTime
pub fn scheduled_at_date(&self) -> &BlockDate
pub fn scheduled_at_time(&self) -> &SystemTime
pub fn wake_at_time(&self) -> &Option<SystemTime>
pub fn finished_at_time(&self) -> &Option<SystemTime>
pub fn status(&self) -> &LeadershipLogStatus
sourcepub fn mark_wake(&mut self)
pub fn mark_wake(&mut self)
make a leadership event as triggered.
This should be called when the leadership event has started.
panic
on non-release build, this function will panic if the log was already marked as awaken.
sourcepub fn mark_finished(&mut self)
pub fn mark_finished(&mut self)
make a leadership event as finished.
This should be called when the leadership event has finished its scheduled action.
panic
on non-release build, this function will panic if the log was already marked as finished.
sourcepub fn set_status(&mut self, status: LeadershipLogStatus)
pub fn set_status(&mut self, status: LeadershipLogStatus)
set the leadership log status.
Trait Implementations§
source§impl Clone for LeadershipLog
impl Clone for LeadershipLog
source§fn clone(&self) -> LeadershipLog
fn clone(&self) -> LeadershipLog
Returns a copy 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 LeadershipLog
impl Debug for LeadershipLog
source§impl<'de> Deserialize<'de> for LeadershipLog
impl<'de> Deserialize<'de> for LeadershipLog
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for LeadershipLog
impl Send for LeadershipLog
impl Sync for LeadershipLog
impl Unpin for LeadershipLog
impl UnwindSafe for LeadershipLog
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