pub struct NostrPubKey(/* private fields */);Expand description
Secp256k1 x-only (schnorr) public key for Nostr transport (32 bytes).
Serializes to/from hex string in JSON.
Implementations§
Source§impl NostrPubKey
impl NostrPubKey
Sourcepub fn from_bytes(bytes: [u8; 32]) -> NostrPubKey
pub fn from_bytes(bytes: [u8; 32]) -> NostrPubKey
Create from raw bytes.
Sourcepub fn from_hex(s: &str) -> Result<NostrPubKey, ParseError>
pub fn from_hex(s: &str) -> Result<NostrPubKey, ParseError>
Parse from hex string.
Trait Implementations§
Source§impl Clone for NostrPubKey
impl Clone for NostrPubKey
Source§fn clone(&self) -> NostrPubKey
fn clone(&self) -> NostrPubKey
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 NostrPubKey
impl Debug for NostrPubKey
Source§impl<'de> Deserialize<'de> for NostrPubKey
impl<'de> Deserialize<'de> for NostrPubKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<NostrPubKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<NostrPubKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for NostrPubKey
impl Display for NostrPubKey
Source§impl Hash for NostrPubKey
impl Hash for NostrPubKey
Source§impl PartialEq for NostrPubKey
impl PartialEq for NostrPubKey
Source§impl Serialize for NostrPubKey
impl Serialize for NostrPubKey
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 Copy for NostrPubKey
impl Eq for NostrPubKey
impl StructuralPartialEq for NostrPubKey
Auto Trait Implementations§
impl Freeze for NostrPubKey
impl RefUnwindSafe for NostrPubKey
impl Send for NostrPubKey
impl Sync for NostrPubKey
impl Unpin for NostrPubKey
impl UnsafeUnpin for NostrPubKey
impl UnwindSafe for NostrPubKey
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more