pub struct MessageMetadata { /* private fields */ }Expand description
Metadata associated with a tangle message.
Implementations§
Source§impl MessageMetadata
impl MessageMetadata
Sourcepub fn new(
flags: Flags,
milestone_index: Option<MilestoneIndex>,
arrival_timestamp: u64,
solidification_timestamp: u64,
reference_timestamp: u64,
omrsi: Option<IndexId>,
ymrsi: Option<IndexId>,
conflict: ConflictReason,
) -> Self
pub fn new( flags: Flags, milestone_index: Option<MilestoneIndex>, arrival_timestamp: u64, solidification_timestamp: u64, reference_timestamp: u64, omrsi: Option<IndexId>, ymrsi: Option<IndexId>, conflict: ConflictReason, ) -> Self
Create a new instance of a message’s metadata.
Sourcepub fn arrived() -> Self
pub fn arrived() -> Self
Create metadata that corresponds to a just-arrived message using the current system time.
Sourcepub fn flags_mut(&mut self) -> &mut Flags
pub fn flags_mut(&mut self) -> &mut Flags
Get a mutable reference to the flags associated with this metadata.
Sourcepub fn milestone_index(&self) -> Option<MilestoneIndex>
pub fn milestone_index(&self) -> Option<MilestoneIndex>
Get the milestone index of this message.
Sourcepub fn set_milestone_index(&mut self, index: MilestoneIndex)
pub fn set_milestone_index(&mut self, index: MilestoneIndex)
Set the milestone index of this message.
Sourcepub fn arrival_timestamp(&self) -> u64
pub fn arrival_timestamp(&self) -> u64
Get the arrival timestamp (seconds from the unix epoch) of this message.
Sourcepub fn solidification_timestamp(&self) -> u64
pub fn solidification_timestamp(&self) -> u64
Get the solidification timestamp (seconds from the unix epoch) of this message.
Sourcepub fn omrsi(&self) -> Option<IndexId>
pub fn omrsi(&self) -> Option<IndexId>
Get the oldest message root snapshot index of this message.
Sourcepub fn set_omrsi(&mut self, omrsi: IndexId)
pub fn set_omrsi(&mut self, omrsi: IndexId)
Set the oldest message root snapshot index of this message.
Sourcepub fn ymrsi(&self) -> Option<IndexId>
pub fn ymrsi(&self) -> Option<IndexId>
Get the youngest message root snapshot index of this message.
Sourcepub fn set_ymrsi(&mut self, ymrsi: IndexId)
pub fn set_ymrsi(&mut self, ymrsi: IndexId)
Set the youngest message root snapshot index of this message.
Sourcepub fn reference_timestamp(&self) -> u64
pub fn reference_timestamp(&self) -> u64
Get the reference timestamp (seconds from the unix epoch) of this message.
Sourcepub fn mark_solid(&mut self)
pub fn mark_solid(&mut self)
Mark this message as solid at the current system time.
Sourcepub fn conflict(&self) -> ConflictReason
pub fn conflict(&self) -> ConflictReason
Get the conflict state of this message.
Sourcepub fn set_conflict(&mut self, conflict: ConflictReason)
pub fn set_conflict(&mut self, conflict: ConflictReason)
Set the conflict state of this message.
Trait Implementations§
Source§impl Clone for MessageMetadata
impl Clone for MessageMetadata
Source§fn clone(&self) -> MessageMetadata
fn clone(&self) -> MessageMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more