pub struct Message {
pub chain: Chain,
pub sender: Address,
pub signature: Signature,
pub content_source: ContentSource,
pub item_hash: ItemHash,
pub confirmations: Vec<MessageConfirmation>,
pub time: Timestamp,
pub channel: Option<Channel>,
pub message_type: MessageType,
pub content: MessageContent,
}Fields§
§chain: ChainBlockchain used for this message.
sender: AddressSender address.
signature: SignatureCryptographic signature of the message by the sender.
content_source: ContentSourceContent of the message as created by the sender. Can either be inline or stored on Aleph Cloud.
item_hash: ItemHashHash of the content (SHA2-256).
confirmations: Vec<MessageConfirmation>List of confirmations for the message.
time: TimestampUnix timestamp or datetime when the message was published.
channel: Option<Channel>Channel of the message, one application ideally has one channel.
message_type: MessageTypeMessage type. (aggregate, forget, instance, post, program, store).
content: MessageContentMessage content.
Implementations§
Source§impl Message
impl Message
pub fn content(&self) -> &MessageContentEnum
pub fn confirmed(&self) -> bool
Sourcepub fn sender(&self) -> &Address
pub fn sender(&self) -> &Address
Returns the address of the sender of the message. Note that the sender is not necessarily the owner of the resources, as the owner may have delegated their authority to create specific resources through the permission system.
Sourcepub fn sent_at(&self) -> &Timestamp
pub fn sent_at(&self) -> &Timestamp
Returns the time at which the message was sent. Notes:
- This value is signed by the sender and should not be trusted accordingly.
- We prefer
content.timeovertimeastimeis not part of the signed payload.
Sourcepub fn confirmed_at(&self) -> Option<&Timestamp>
pub fn confirmed_at(&self) -> Option<&Timestamp>
Returns the earliest confirmation time of the message.