pub struct DidCommHeader {
pub id: String,
pub thid: Option<String>,
pub pthid: Option<String>,
pub m_type: String,
pub to: Vec<String>,
pub from: Option<String>,
pub created_time: Option<u64>,
pub expires_time: Option<u64>,
pub thread: Option<Thread>,
/* private fields */
}Expand description
Collection of DIDComm message specific headers, will be flattened into DIDComm plain message according to spec.
Fields§
§id: String§thid: Option<String>§pthid: Option<String>§m_type: String§to: Vec<String>§from: Option<String>§created_time: Option<u64>§expires_time: Option<u64>§thread: Option<Thread>Optional thread decorator.
Implementations§
Source§impl DidCommHeader
impl DidCommHeader
Sourcepub fn gen_random_id() -> String
pub fn gen_random_id() -> String
Generates random id
TODO: Should this be public?
Sourcepub fn get_message_uri(&self) -> String
pub fn get_message_uri(&self) -> String
Returns DIDComm message URI as defined by spec: https://identity.foundation/didcomm-messaging/spec/#didcomm-message-uris
Sourcepub fn reply_to(&mut self, sender_header: &Self)
pub fn reply_to(&mut self, sender_header: &Self)
Sets new message’s header thid and pthid using sender’s header.
It also adds sender_header.from into to set.
§Parameters
sender_header- ref to header we’re replying
Sourcepub fn from_prior(&self) -> Option<&PriorClaims>
pub fn from_prior(&self) -> Option<&PriorClaims>
Getter method for from_prior retrieval
Trait Implementations§
Source§impl Clone for DidCommHeader
impl Clone for DidCommHeader
Source§fn clone(&self) -> DidCommHeader
fn clone(&self) -> DidCommHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DidCommHeader
impl Debug for DidCommHeader
Source§impl Default for DidCommHeader
impl Default for DidCommHeader
Source§impl<'de> Deserialize<'de> for DidCommHeader
impl<'de> Deserialize<'de> for DidCommHeader
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DidCommHeader
impl PartialEq for DidCommHeader
Source§impl Serialize for DidCommHeader
impl Serialize for DidCommHeader
impl Eq for DidCommHeader
impl StructuralPartialEq for DidCommHeader
Auto Trait Implementations§
impl Freeze for DidCommHeader
impl RefUnwindSafe for DidCommHeader
impl Send for DidCommHeader
impl Sync for DidCommHeader
impl Unpin for DidCommHeader
impl UnsafeUnpin for DidCommHeader
impl UnwindSafe for DidCommHeader
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
Mutably borrows from an owned value. Read more