UpdateParty

Struct UpdateParty 

Source
pub struct UpdateParty {
    pub transaction_id: String,
    pub party_type: String,
    pub party: Party,
    pub context: Option<String>,
}
Expand description

UpdateParty message body (TAIP-6).

This message type allows agents to update party information in a transaction. It enables a participant to modify their details or role within an existing transfer without creating a new transaction. This is particularly useful for situations where participant information changes during the lifecycle of a transaction.

§TAIP-6 Specification

The UpdateParty message follows the TAIP-6 specification for updating party information in a TAP transaction. It includes JSON-LD compatibility with an optional @context field.

§Example

use tap_msg::message::update_party::UpdateParty;
use tap_msg::message::Party;
use std::collections::HashMap;

// Create a party with updated information
let updated_party = Party::new("did:key:z6MkpDYxrwJw5WoD1o4YVfthJJgZfxrECpW6Da6QCWagRHLx")
    .with_country("de");

// Create an UpdateParty message
let update_party = UpdateParty::new(
    "transfer-123",
    "originator",
    updated_party
);

Fields§

§transaction_id: String

ID of the transaction this update relates to.

§party_type: String

Type of party being updated (e.g., ‘originator’, ‘beneficiary’).

§party: Party

Updated party information.

§context: Option<String>

Optional context for the update.

Implementations§

Source§

impl UpdateParty

Source

pub fn new(transaction_id: &str, party_type: &str, party: Party) -> Self

Creates a new UpdateParty message body.

Source

pub fn validate_update_party(&self) -> Result<()>

Custom validation for UpdateParty messages

Source§

impl UpdateParty

Source

pub fn validate(&self) -> Result<()>

Implementation of the validate method for the TapMessageBody trait This delegates to the custom validation method

Trait Implementations§

Source§

impl Clone for UpdateParty

Source§

fn clone(&self) -> UpdateParty

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UpdateParty

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for UpdateParty

Source§

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 MessageContext for UpdateParty

Source§

fn participant_dids(&self) -> Vec<String>

Extract all participant DIDs from the message This replaces the old participants() method and works with Agent/Party types directly
Source§

fn transaction_context(&self) -> Option<TransactionContext>

Get transaction context if applicable
Source§

fn routing_hints(&self) -> RoutingHints

Get routing hints for message delivery
Source§

fn transaction_id(&self) -> Option<String>

Get transaction ID if available
Source§

impl Serialize for UpdateParty

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TapMessage for UpdateParty

Source§

fn validate(&self) -> Result<()>

Validates a TAP message. Read more
Source§

fn is_tap_message(&self) -> bool

Checks if this message is a TAP message.
Source§

fn get_tap_type(&self) -> Option<String>

Gets the TAP message type from this message.
Source§

fn body_as<T: TapMessageBody>(&self) -> Result<T>

Extract a specific message body type from this message. Read more
Source§

fn get_all_participants(&self) -> Vec<String>

Get all participant DIDs from this message. Read more
Source§

fn create_reply<T: TapMessageBody>( &self, body: &T, creator_did: &str, ) -> Result<PlainMessage>

Create a reply to this message. Read more
Source§

fn thread_id(&self) -> Option<&str>

Get the thread ID for this message
Source§

fn parent_thread_id(&self) -> Option<&str>

Get the parent thread ID for this message
Source§

fn message_id(&self) -> &str

Get the message ID for this message
Source§

impl TapMessageBody for UpdateParty

Source§

fn message_type() -> &'static str

Get the message type string for this body type.
Source§

fn validate(&self) -> Result<()>

Validate the message body.
Source§

fn to_didcomm(&self, from_did: &str) -> Result<PlainMessage>

Convert this body to a DIDComm message.
Source§

fn to_didcomm_with_route<'a, I>( &self, from: &str, to: I, ) -> Result<PlainMessage>
where I: IntoIterator<Item = &'a str>,

Convert this body to a DIDComm message with a custom routing path. Read more
Source§

fn from_didcomm(message: &PlainMessage) -> Result<Self>
where Self: Sized,

Extract this body type from a DIDComm message.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,