pub struct MessageV0Header {
pub sender: VerifyingKey,
pub when: u64,
pub kind: Kind,
pub tags: Vec<Tag>,
}Expand description
Header information for MessageV0 containing metadata and routing information.
§MessageV0Header Structure
MessageV0Header contains all the metadata fields from a MessageV0 message
except for the content payload. This allows RPC transport layers to access
sender information, timing, message types, and routing tags without having
to deserialize the potentially encrypted content.
§Field Description
sender: Ed25519 public key of the message authorwhen: Unix timestamp in seconds (for ordering and expiration)kind: Message type determining storage and forwarding behaviortags: Routing and reference tags (channels, users, events)
§Usage in RPC Transport
This header allows RPC systems to examine message metadata before deciding how to handle the content, enabling efficient routing and access control.
Fields§
§sender: VerifyingKeyML-DSA public key of the message sender (serialized as bytes).
This key is used to verify the digital signature in MessageFull.
The sender must possess the corresponding private key to create valid signatures.
Stored as encoded bytes for serialization compatibility.
when: u64Unix timestamp in seconds when the message was created.
Used for:
- Message ordering in conversations
- Expiration of ephemeral messages
- Preventing replay attacks (with reasonable clock skew tolerance)
kind: KindMessage type determining storage and forwarding behavior.
See Kind for details on different message types:
Regular: Stored permanentlyEphemeral: Temporary storage with optional TTLStore: Updates a specific key-value storeClearStore: Clears a key-value store
Tags for routing, references, and metadata.
Common tag types include:
Protected: Message should only be forwarded to authenticated recipientsEvent: References another message or event by IDUser: References a user identityChannel: Routes to a specific channel or group
Default value is an empty vector when deserializing legacy messages.
Trait Implementations§
Source§impl Clone for MessageV0Header
impl Clone for MessageV0Header
Source§fn clone(&self) -> MessageV0Header
fn clone(&self) -> MessageV0Header
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageV0Header
impl Debug for MessageV0Header
Source§impl<'de> Deserialize<'de> for MessageV0Header
impl<'de> Deserialize<'de> for MessageV0Header
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for MessageV0Header
Manual PartialEq implementation for MessageV0Header
impl PartialEq for MessageV0Header
Manual PartialEq implementation for MessageV0Header
Source§impl Serialize for MessageV0Header
impl Serialize for MessageV0Header
impl Eq for MessageV0Header
Manual Eq implementation for MessageV0Header
Auto Trait Implementations§
impl Freeze for MessageV0Header
impl RefUnwindSafe for MessageV0Header
impl Send for MessageV0Header
impl Sync for MessageV0Header
impl Unpin for MessageV0Header
impl UnwindSafe for MessageV0Header
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.