pub struct Notification {
pub notification_type: NotificationType,
pub notification: NotificationResult,
}Expand description
NIP-47 Notification
Fields§
§notification_type: NotificationTypeNotification type
notification: NotificationResultNotification result
Implementations§
Source§impl Notification
impl Notification
Sourcepub fn from_event(
uri: &NostrWalletConnectURI,
event: &Event,
) -> Result<Self, Error>
pub fn from_event( uri: &NostrWalletConnectURI, event: &Event, ) -> Result<Self, Error>
Deserialize from Event
Sourcepub fn from_value(value: Value) -> Result<Self, Error>
pub fn from_value(value: Value) -> Result<Self, Error>
Deserialize from JSON string
Sourcepub fn to_pay_notification(self) -> Result<PaymentNotification, Error>
pub fn to_pay_notification(self) -> Result<PaymentNotification, Error>
Convert Notification to PaymentNotification
Sourcepub fn to_holdinvoice_accepted_notification(
self,
) -> Result<HoldInvoiceAcceptedNotification, Error>
pub fn to_holdinvoice_accepted_notification( self, ) -> Result<HoldInvoiceAcceptedNotification, Error>
Convert Notification to HoldInvoiceAcceptedNotification
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
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 Notification
impl Debug for Notification
Source§impl<'de> Deserialize<'de> for Notification
impl<'de> Deserialize<'de> for Notification
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 JsonUtil for Notification
impl JsonUtil for Notification
Source§fn as_pretty_json(&self) -> String
fn as_pretty_json(&self) -> String
Serialize as pretty JSON string Read more
Source§impl PartialEq for Notification
impl PartialEq for Notification
Source§impl Serialize for Notification
impl Serialize for Notification
impl Eq for Notification
impl StructuralPartialEq for Notification
Auto Trait Implementations§
impl Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnwindSafe for Notification
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