pub struct Nip19Identifier { /* private fields */ }Expand description
A bounded, parsed NIP-19 value.
Implementations§
Source§impl Nip19Identifier
impl Nip19Identifier
Sourcepub fn parse(encoded: &str) -> Result<Self, SoftchatError>
pub fn parse(encoded: &str) -> Result<Self, SoftchatError>
Parse one supported NIP-19 identifier.
Secret keys and addressable-event coordinates are deliberately outside this display-only Softchat boundary. Unknown TLVs are retained.
§Errors
Returns SoftchatError::InvalidNip19Identifier for malformed,
mixed-case, unsupported, oversized, duplicate, or invalid values.
Sourcepub fn encode(&self) -> Result<String, SoftchatError>
pub fn encode(&self) -> Result<String, SoftchatError>
Encode the canonical lowercase representation.
§Errors
Returns SoftchatError::InvalidNip19Identifier if retained fields no
longer satisfy the bounded Softchat profile.
Sourcepub const fn kind(&self) -> Nip19IdentifierKind
pub const fn kind(&self) -> Nip19IdentifierKind
Identifier family.
Sourcepub fn primary_hex(&self) -> &str
pub fn primary_hex(&self) -> &str
Canonical public key or event ID hexadecimal value.
Optional event author for nevent.
Sourcepub const fn event_kind(&self) -> Option<NostrEventKind>
pub const fn event_kind(&self) -> Option<NostrEventKind>
Optional event kind for nevent.
Sourcepub fn unknown_tlvs(&self) -> &[Nip19Tlv]
pub fn unknown_tlvs(&self) -> &[Nip19Tlv]
Unknown TLVs retained without interpretation.
Trait Implementations§
Source§impl Clone for Nip19Identifier
impl Clone for Nip19Identifier
Source§fn clone(&self) -> Nip19Identifier
fn clone(&self) -> Nip19Identifier
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 Nip19Identifier
impl Debug for Nip19Identifier
Source§impl PartialEq for Nip19Identifier
impl PartialEq for Nip19Identifier
Source§fn eq(&self, other: &Nip19Identifier) -> bool
fn eq(&self, other: &Nip19Identifier) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for Nip19Identifier
impl StructuralPartialEq for Nip19Identifier
Auto Trait Implementations§
impl Freeze for Nip19Identifier
impl RefUnwindSafe for Nip19Identifier
impl Send for Nip19Identifier
impl Sync for Nip19Identifier
impl Unpin for Nip19Identifier
impl UnsafeUnpin for Nip19Identifier
impl UnwindSafe for Nip19Identifier
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more