pub struct MessageHeader {
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,
}Expand description
A message without its deserialized content.
Used by the verified message path: the client fetches message headers, then downloads
and verifies raw content separately before deserializing it. This avoids trusting
the CCN’s pre-deserialized content field.
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).
Implementations§
Source§impl MessageHeader
impl MessageHeader
Sourcepub fn with_content(self, content: MessageContent) -> Message
pub fn with_content(self, content: MessageContent) -> Message
Assembles a full Message by combining this header with deserialized content.
Sourcepub fn verify_signature(&self) -> Result<(), SignatureVerificationError>
pub fn verify_signature(&self) -> Result<(), SignatureVerificationError>
Verifies that the message signature was produced by the sender.
Signature verification only depends on header fields (chain, sender, signature, message_type, item_hash), so it can run before content is downloaded or deserialized.
Trait Implementations§
Source§impl Clone for MessageHeader
impl Clone for MessageHeader
Source§fn clone(&self) -> MessageHeader
fn clone(&self) -> MessageHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more