Struct nostr_sdk::UnsignedEvent
source · pub struct UnsignedEvent {
pub id: EventId,
pub pubkey: XOnlyPublicKey,
pub created_at: Timestamp,
pub kind: Kind,
pub tags: Vec<Tag, Global>,
pub content: String,
}
Expand description
UnsignedEvent
struct
Fields§
§id: EventId
Id
pubkey: XOnlyPublicKey
Author
created_at: Timestamp
Timestamp (seconds)
kind: Kind
Kind
Vector of Tag
content: String
Content
Implementations§
source§impl UnsignedEvent
impl UnsignedEvent
sourcepub fn sign_with_ctx<C, R>(
self,
secp: &Secp256k1<C>,
rng: &mut R,
keys: &Keys
) -> Result<Event, Error>where
C: Signing,
R: Rng + CryptoRng,
pub fn sign_with_ctx<C, R>( self, secp: &Secp256k1<C>, rng: &mut R, keys: &Keys ) -> Result<Event, Error>where C: Signing, R: Rng + CryptoRng,
Sign an UnsignedEvent
sourcepub fn add_signature(self, sig: Signature) -> Result<Event, Error>
pub fn add_signature(self, sig: Signature) -> Result<Event, Error>
Add signature to UnsignedEvent
sourcepub fn add_signature_with_ctx<C>(
self,
secp: &Secp256k1<C>,
sig: Signature
) -> Result<Event, Error>where
C: Verification,
pub fn add_signature_with_ctx<C>( self, secp: &Secp256k1<C>, sig: Signature ) -> Result<Event, Error>where C: Verification,
Add signature to UnsignedEvent
Trait Implementations§
source§impl Clone for UnsignedEvent
impl Clone for UnsignedEvent
source§fn clone(&self) -> UnsignedEvent
fn clone(&self) -> UnsignedEvent
Returns a copy 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 UnsignedEvent
impl Debug for UnsignedEvent
source§impl<'de> Deserialize<'de> for UnsignedEvent
impl<'de> Deserialize<'de> for UnsignedEvent
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<UnsignedEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<UnsignedEvent, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for UnsignedEvent
impl Hash for UnsignedEvent
source§impl Ord for UnsignedEvent
impl Ord for UnsignedEvent
source§fn cmp(&self, other: &UnsignedEvent) -> Ordering
fn cmp(&self, other: &UnsignedEvent) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<UnsignedEvent> for UnsignedEvent
impl PartialEq<UnsignedEvent> for UnsignedEvent
source§fn eq(&self, other: &UnsignedEvent) -> bool
fn eq(&self, other: &UnsignedEvent) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<UnsignedEvent> for UnsignedEvent
impl PartialOrd<UnsignedEvent> for UnsignedEvent
source§fn partial_cmp(&self, other: &UnsignedEvent) -> Option<Ordering>
fn partial_cmp(&self, other: &UnsignedEvent) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for UnsignedEvent
impl Serialize for UnsignedEvent
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,
Serialize this value into the given Serde serializer. Read more
impl Eq for UnsignedEvent
impl StructuralEq for UnsignedEvent
impl StructuralPartialEq for UnsignedEvent
Auto Trait Implementations§
impl RefUnwindSafe for UnsignedEvent
impl Send for UnsignedEvent
impl Sync for UnsignedEvent
impl Unpin for UnsignedEvent
impl UnwindSafe for UnsignedEvent
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.