pub struct Id(pub [u8; 32]);
Expand description
An event identifier, constructed as a SHA256 hash of the event fields according to NIP-01
Tuple Fields§
§0: [u8; 32]
Implementations§
Source§impl Id
impl Id
Sourcepub fn as_hex_string(&self) -> String
pub fn as_hex_string(&self) -> String
Render into a hexadecimal string
Consider converting .into()
an IdHex
which is a wrapped type rather than a naked String
Sourcepub fn as_bech32_string(&self) -> String
pub fn as_bech32_string(&self) -> String
Export as a bech32 encoded string (“note”)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
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 Ord for Id
impl Ord for Id
Source§impl PartialOrd for Id
impl PartialOrd for Id
impl Copy for Id
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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