Struct bee_tangle::metadata::MessageMetadata [−][src]
pub struct MessageMetadata { /* fields omitted */ }Expand description
Metadata associated with a tangle message.
Implementations
impl MessageMetadata[src]
impl MessageMetadata[src]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[src]
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[src]Create a new instance of a message’s metadata.
pub fn arrived() -> Self[src]
pub fn arrived() -> Self[src]Create metadata that corresponds to a just-arrived message using the current system time.
pub fn flags_mut(&mut self) -> &mut Flags[src]
pub fn flags_mut(&mut self) -> &mut Flags[src]Get a mutable reference to the flags associated with this metadata.
pub fn milestone_index(&self) -> Option<MilestoneIndex>[src]
pub fn milestone_index(&self) -> Option<MilestoneIndex>[src]Get the milestone index of this message.
pub fn set_milestone_index(&mut self, index: MilestoneIndex)[src]
pub fn set_milestone_index(&mut self, index: MilestoneIndex)[src]Set the milestone index of this message.
pub fn arrival_timestamp(&self) -> u64[src]
pub fn arrival_timestamp(&self) -> u64[src]Get the arrival timestamp (seconds from the unix epoch) of this message.
pub fn solidification_timestamp(&self) -> u64[src]
pub fn solidification_timestamp(&self) -> u64[src]Get the solidification timestamp (seconds from the unix epoch) of this message.
pub fn omrsi(&self) -> Option<IndexId>[src]
pub fn omrsi(&self) -> Option<IndexId>[src]Get the oldest message root snapshot index of this message.
pub fn set_omrsi(&mut self, omrsi: IndexId)[src]
pub fn set_omrsi(&mut self, omrsi: IndexId)[src]Set the oldest message root snapshot index of this message.
pub fn ymrsi(&self) -> Option<IndexId>[src]
pub fn ymrsi(&self) -> Option<IndexId>[src]Get the youngest message root snapshot index of this message.
pub fn set_ymrsi(&mut self, ymrsi: IndexId)[src]
pub fn set_ymrsi(&mut self, ymrsi: IndexId)[src]Set the youngest message root snapshot index of this message.
pub fn reference_timestamp(&self) -> u64[src]
pub fn reference_timestamp(&self) -> u64[src]Get the reference timestamp (seconds from the unix epoch) of this message.
pub fn mark_solid(&mut self)[src]
pub fn mark_solid(&mut self)[src]Mark this message as solid at the current system time.
pub fn conflict(&self) -> ConflictReason[src]
pub fn conflict(&self) -> ConflictReason[src]Get the conflict state of this message.
pub fn set_conflict(&mut self, conflict: ConflictReason)[src]
pub fn set_conflict(&mut self, conflict: ConflictReason)[src]Set the conflict state of this message.
Trait Implementations
impl Clone for MessageMetadata[src]
impl Clone for MessageMetadata[src]fn clone(&self) -> MessageMetadata[src]
fn clone(&self) -> MessageMetadata[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for MessageMetadata[src]
impl Debug for MessageMetadata[src]impl Default for MessageMetadata[src]
impl Default for MessageMetadata[src]fn default() -> MessageMetadata[src]
fn default() -> MessageMetadata[src]Returns the “default value” for a type. Read more
impl<B: StorageBackend> Hooks<MessageMetadata> for StorageHooks<B>[src]
impl<B: StorageBackend> Hooks<MessageMetadata> for StorageHooks<B>[src]fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 MessageId
) -> Pin<Box<dyn Future<Output = Result<Option<(Message, MessageMetadata)>, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 MessageId
) -> Pin<Box<dyn Future<Output = Result<Option<(Message, MessageMetadata)>, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]Fetch a message from some external storage medium.
fn insert<'life0, 'async_trait>(
&'life0 self,
id: MessageId,
tx: Message,
metadata: MessageMetadata
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
fn insert<'life0, 'async_trait>(
&'life0 self,
id: MessageId,
tx: Message,
metadata: MessageMetadata
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]Insert a message into some external storage medium.
fn fetch_approvers<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 MessageId
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<MessageId>>, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
fn fetch_approvers<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 MessageId
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<MessageId>>, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]Fetch the approvers list for a given message.
fn insert_approver<'life0, 'async_trait>(
&'life0 self,
id: MessageId,
approver: MessageId
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]
fn insert_approver<'life0, 'async_trait>(
&'life0 self,
id: MessageId,
approver: MessageId
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait, [src]Insert a new approver for a given message.
fn update_approvers<'life0, 'life1, 'async_trait>(
&'life0 self,
id: MessageId,
approvers: &'life1 [MessageId]
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]
fn update_approvers<'life0, 'life1, 'async_trait>(
&'life0 self,
id: MessageId,
approvers: &'life1 [MessageId]
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait, [src]Update the approvers list for a given message.
impl Packable for MessageMetadata[src]
impl Packable for MessageMetadata[src]type Error = MessageMetadataError
type Error = MessageMetadataErrorAssociated error type.
fn packed_len(&self) -> usize[src]
fn packed_len(&self) -> usize[src]Returns the length of the packed bytes.
fn pack<W: Write>(&self, writer: &mut W) -> Result<(), Self::Error>[src]
fn pack<W: Write>(&self, writer: &mut W) -> Result<(), Self::Error>[src]Packs the instance to bytes and writes them to the passed writer.
fn unpack_inner<R: Read + ?Sized, const CHECK: bool>(
reader: &mut R
) -> Result<Self, Self::Error>[src]
fn unpack_inner<R: Read + ?Sized, const CHECK: bool>(
reader: &mut R
) -> Result<Self, Self::Error>[src]Reads bytes from the passed reader and unpacks them into an instance.
fn pack_new(&self) -> Vec<u8, Global>[src]
fn pack_new(&self) -> Vec<u8, Global>[src]Packs the instance to bytes and writes them to a newly allocated vector.
impl Serialize for MessageMetadata[src]
impl Serialize for MessageMetadata[src]impl Copy for MessageMetadata[src]
Auto Trait Implementations
impl RefUnwindSafe for MessageMetadata
impl Send for MessageMetadata
impl Sync for MessageMetadata
impl Unpin for MessageMetadata
impl UnwindSafe for MessageMetadata
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,