Struct bee_tangle::metadata::MessageMetadata[][src]

pub struct MessageMetadata { /* fields omitted */ }
Expand description

Metadata associated with a tangle message.

Implementations

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]

Create a new instance of a message’s metadata.

pub fn arrived() -> Self[src]

Create metadata that corresponds to a just-arrived message using the current system time.

pub fn flags(&self) -> &Flags[src]

Get the flags associated with this metadata.

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]

Get the milestone index of this message.

pub fn set_milestone_index(&mut self, index: MilestoneIndex)[src]

Set the milestone index of this message.

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]

Get the solidification timestamp (seconds from the unix epoch) of this message.

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]

Set the oldest message root snapshot index of this message.

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]

Set the youngest message root snapshot index of this message.

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]

Mark this message as solid at the current system time.

pub fn reference(&mut self, timestamp: u64)[src]

Reference this message with the given timestamp.

pub fn conflict(&self) -> ConflictReason[src]

Get the conflict state of this message.

pub fn set_conflict(&mut self, conflict: ConflictReason)[src]

Set the conflict state of this message.

Trait Implementations

impl Clone for 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]

Performs copy-assignment from source. Read more

impl Debug for MessageMetadata[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for MessageMetadata[src]

fn default() -> MessageMetadata[src]

Returns the “default value” for a type. Read more

impl<B: StorageBackend> Hooks<MessageMetadata> for StorageHooks<B>[src]

type Error = B::Error

An error generated by these hooks.

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]

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]

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]

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]

Update the approvers list for a given message.

impl Packable for MessageMetadata[src]

type Error = MessageMetadataError

Associated error type.

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]

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]

Reads bytes from the passed reader and unpacks them into an instance.

fn pack_new(&self) -> Vec<u8, Global>[src]

Packs the instance to bytes and writes them to a newly allocated vector.

fn unpack<R>(reader: &mut R) -> Result<Self, Self::Error> where
    R: Read + ?Sized
[src]

Reads bytes from the passed reader and unpacks them into an instance. Applies syntactic checks. Read more

fn unpack_unchecked<R>(reader: &mut R) -> Result<Self, Self::Error> where
    R: Read + ?Sized
[src]

Reads bytes from the passed reader and unpacks them into an instance. Doesn’t apply syntactic checks. Read more

impl Serialize for MessageMetadata[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl Copy for MessageMetadata[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]

🔬 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<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V