pub struct PaymentMetadata {
pub entries: HashMap<String, String>,
}Expand description
Opaque key-value metadata attached to a send intent
Stored for future extensions. In v1 no behavior is driven by metadata values. Future features like payjoin may consume this metadata.
Fields§
§entries: HashMap<String, String>Key-value pairs
Implementations§
Source§impl PaymentMetadata
impl PaymentMetadata
Sourcepub fn from_optional_json(json: Option<&str>) -> Self
pub fn from_optional_json(json: Option<&str>) -> Self
Create metadata from an optional JSON string.
Accepts either a bare {"key": "value"} object (interpreted as the
entries map) or the full struct form {"entries": {"key": "value"}}.
Trait Implementations§
Source§impl Clone for PaymentMetadata
impl Clone for PaymentMetadata
Source§fn clone(&self) -> PaymentMetadata
fn clone(&self) -> PaymentMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PaymentMetadata
impl Debug for PaymentMetadata
Source§impl Default for PaymentMetadata
impl Default for PaymentMetadata
Source§fn default() -> PaymentMetadata
fn default() -> PaymentMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PaymentMetadata
impl<'de> Deserialize<'de> for PaymentMetadata
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
impl Eq for PaymentMetadata
Source§impl PartialEq for PaymentMetadata
impl PartialEq for PaymentMetadata
Source§fn eq(&self, other: &PaymentMetadata) -> bool
fn eq(&self, other: &PaymentMetadata) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PaymentMetadata
impl Serialize for PaymentMetadata
impl StructuralPartialEq for PaymentMetadata
Auto Trait Implementations§
impl Freeze for PaymentMetadata
impl RefUnwindSafe for PaymentMetadata
impl Send for PaymentMetadata
impl Sync for PaymentMetadata
impl Unpin for PaymentMetadata
impl UnsafeUnpin for PaymentMetadata
impl UnwindSafe for PaymentMetadata
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