pub struct PlainMessage {Show 13 fields
pub id: String,
pub typ: String,
pub type_: String,
pub body: Value,
pub from: String,
pub to: Vec<String>,
pub thid: Option<String>,
pub pthid: Option<String>,
pub extra_headers: HashMap<String, Value>,
pub created_time: Option<u64>,
pub expires_time: Option<u64>,
pub from_prior: Option<String>,
pub attachments: Option<Vec<Attachment>>,
}Expand description
Wrapper for plain message. Provides helpers for message building and packing/unpacking. Adapted from https://github.com/sicpa-dlab/didcomm-rust/blob/main/src/message/message.rs
Fields§
§id: StringMessage id. Must be unique to the sender.
typ: StringOptional, if present it must be “application/didcomm-plain+json”
type_: StringMessage type attribute value MUST be a valid Message Type URI, that when resolved gives human readable information about the message. The attribute’s value also informs the content of the message, or example the presence of other attributes and how they should be processed.
body: ValueMessage body.
from: StringSender identifier. The from attribute MUST be a string that is a valid DID or DID URL (without the fragment component) which identifies the sender of the message.
to: Vec<String>Identifier(s) for recipients. MUST be an array of strings where each element is a valid DID or DID URL (without the fragment component) that identifies a member of the message’s intended audience.
thid: Option<String>Uniquely identifies the thread that the message belongs to.
If not included the id property of the message MUST be treated as the value of the thid.
pthid: Option<String>If the message is a child of a thread the pthid
will uniquely identify which thread is the parent.
extra_headers: HashMap<String, Value>Custom message headers.
created_time: Option<u64>The attribute is used for the sender to express when they created the message, expressed in UTC Epoch Seconds (seconds since 1970-01-01T00:00:00Z UTC). This attribute is informative to the recipient, and may be relied on by protocols.
expires_time: Option<u64>The expires_time attribute is used for the sender to express when they consider the message to be expired, expressed in UTC Epoch Seconds (seconds since 1970-01-01T00:00:00Z UTC). This attribute signals when the message is considered no longer valid by the sender. When omitted, the message is considered to have no expiration by the sender.
from_prior: Option<String>from_prior is a compactly serialized signed JWT containing FromPrior value
attachments: Option<Vec<Attachment>>Trait Implementations§
Source§impl Clone for PlainMessage
impl Clone for PlainMessage
Source§fn clone(&self) -> PlainMessage
fn clone(&self) -> PlainMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Connectable for PlainMessage
impl Connectable for PlainMessage
Source§fn with_connection(&mut self, connect_id: &str) -> &mut PlainMessage
fn with_connection(&mut self, connect_id: &str) -> &mut PlainMessage
Source§fn has_connection(&self) -> bool
fn has_connection(&self) -> bool
Source§impl Debug for PlainMessage
impl Debug for PlainMessage
Source§impl<'de> Deserialize<'de> for PlainMessage
impl<'de> Deserialize<'de> for PlainMessage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PlainMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PlainMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Packable for PlainMessage
Implement Packable for PlainMessage
impl Packable for PlainMessage
Implement Packable for PlainMessage
Source§fn pack<'life0, 'life1, 'async_trait>(
&'life0 self,
key_manager: &'life1 (impl 'async_trait + KeyManagerPacking + ?Sized),
options: PackOptions,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pack<'life0, 'life1, 'async_trait>(
&'life0 self,
key_manager: &'life1 (impl 'async_trait + KeyManagerPacking + ?Sized),
options: PackOptions,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl PartialEq for PlainMessage
impl PartialEq for PlainMessage
Source§impl Serialize for PlainMessage
impl Serialize for PlainMessage
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl TapMessage for PlainMessage
impl TapMessage for PlainMessage
Source§fn is_tap_message(&self) -> bool
fn is_tap_message(&self) -> bool
Source§fn get_tap_type(&self) -> Option<String>
fn get_tap_type(&self) -> Option<String>
Source§fn body_as<T>(&self) -> Result<T, Error>where
T: TapMessageBody,
fn body_as<T>(&self) -> Result<T, Error>where
T: TapMessageBody,
Source§fn get_all_participants(&self) -> Vec<String>
fn get_all_participants(&self) -> Vec<String>
Source§fn message_type(&self) -> &'static str
fn message_type(&self) -> &'static str
Source§fn parent_thread_id(&self) -> Option<&str>
fn parent_thread_id(&self) -> Option<&str>
Source§fn message_id(&self) -> &str
fn message_id(&self) -> &str
Source§fn create_reply<T>(
&self,
body: &T,
creator_did: &str,
) -> Result<PlainMessage, Error>where
T: TapMessageBody,
fn create_reply<T>(
&self,
body: &T,
creator_did: &str,
) -> Result<PlainMessage, Error>where
T: TapMessageBody,
impl Eq for PlainMessage
impl StructuralPartialEq for PlainMessage
Auto Trait Implementations§
impl Freeze for PlainMessage
impl RefUnwindSafe for PlainMessage
impl Send for PlainMessage
impl Sync for PlainMessage
impl Unpin for PlainMessage
impl UnwindSafe for PlainMessage
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.