Struct nostr_sdk::nips::nip26::DelegationTag
source · pub struct DelegationTag { /* private fields */ }
Expand description
Delegation tag, as defined in NIP-26
Implementations§
source§impl DelegationTag
impl DelegationTag
sourcepub fn new(
delegator_keys: &Keys,
delegatee_pubkey: XOnlyPublicKey,
conditions: Conditions
) -> Result<DelegationTag, Error>
pub fn new( delegator_keys: &Keys, delegatee_pubkey: XOnlyPublicKey, conditions: Conditions ) -> Result<DelegationTag, Error>
Create a delegation tag (including the signature).
sourcepub fn new_with_ctx<C, R>(
secp: &Secp256k1<C>,
rng: &mut R,
delegator_keys: &Keys,
delegatee_pubkey: XOnlyPublicKey,
conditions: Conditions
) -> Result<DelegationTag, Error>where
C: Signing,
R: Rng + CryptoRng,
pub fn new_with_ctx<C, R>( secp: &Secp256k1<C>, rng: &mut R, delegator_keys: &Keys, delegatee_pubkey: XOnlyPublicKey, conditions: Conditions ) -> Result<DelegationTag, Error>where C: Signing, R: Rng + CryptoRng,
Create a delegation tag (including the signature).
sourcepub fn delegator_pubkey(&self) -> XOnlyPublicKey
pub fn delegator_pubkey(&self) -> XOnlyPublicKey
Get delegator public key
sourcepub fn conditions(&self) -> Conditions
pub fn conditions(&self) -> Conditions
Get conditions
sourcepub fn validate(
&self,
delegatee_pubkey: XOnlyPublicKey,
event_properties: &EventProperties
) -> Result<(), Error>
pub fn validate( &self, delegatee_pubkey: XOnlyPublicKey, event_properties: &EventProperties ) -> Result<(), Error>
Validate a delegation tag, check signature and conditions.
sourcepub fn validate_with_ctx<C>(
&self,
secp: &Secp256k1<C>,
delegatee_pubkey: XOnlyPublicKey,
event_properties: &EventProperties
) -> Result<(), Error>where
C: Verification,
pub fn validate_with_ctx<C>( &self, secp: &Secp256k1<C>, delegatee_pubkey: XOnlyPublicKey, event_properties: &EventProperties ) -> Result<(), Error>where C: Verification,
Validate a delegation tag, check signature and conditions.
Trait Implementations§
source§impl Clone for DelegationTag
impl Clone for DelegationTag
source§fn clone(&self) -> DelegationTag
fn clone(&self) -> DelegationTag
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 DelegationTag
impl Debug for DelegationTag
source§impl Display for DelegationTag
impl Display for DelegationTag
source§impl FromStr for DelegationTag
impl FromStr for DelegationTag
source§impl Hash for DelegationTag
impl Hash for DelegationTag
source§impl Ord for DelegationTag
impl Ord for DelegationTag
source§fn cmp(&self, other: &DelegationTag) -> Ordering
fn cmp(&self, other: &DelegationTag) -> 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<DelegationTag> for DelegationTag
impl PartialEq<DelegationTag> for DelegationTag
source§fn eq(&self, other: &DelegationTag) -> bool
fn eq(&self, other: &DelegationTag) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<DelegationTag> for DelegationTag
impl PartialOrd<DelegationTag> for DelegationTag
source§fn partial_cmp(&self, other: &DelegationTag) -> Option<Ordering>
fn partial_cmp(&self, other: &DelegationTag) -> 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 moreimpl Eq for DelegationTag
impl StructuralEq for DelegationTag
impl StructuralPartialEq for DelegationTag
Auto Trait Implementations§
impl RefUnwindSafe for DelegationTag
impl Send for DelegationTag
impl Sync for DelegationTag
impl Unpin for DelegationTag
impl UnwindSafe for DelegationTag
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.