Struct nostr_types::Signature
source · pub struct Signature(pub Signature);
Expand description
A Schnorr signature that signs an Event, taken on the Event Id field
Tuple Fields§
§0: Signature
Implementations§
Methods from Deref<Target = Signature>§
pub fn verify(&self, msg: &Message, pk: &XOnlyPublicKey) -> Result<(), Error>
pub fn verify(&self, msg: &Message, pk: &XOnlyPublicKey) -> Result<(), Error>
Verifies a schnorr signature for msg
using pk
and the global [SECP256K1
] context.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
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 From<Signature> for SignatureHex
impl From<Signature> for SignatureHex
source§fn from(s: Signature) -> SignatureHex
fn from(s: Signature) -> SignatureHex
Converts to this type from the input type.
source§impl PartialEq for Signature
impl PartialEq for Signature
source§impl<'a, C: Context> Readable<'a, C> for Signature
impl<'a, C: Context> Readable<'a, C> for Signature
fn read_from<R: Reader<'a, C>>(reader: &mut R) -> Result<Self, C::Error>
fn minimum_bytes_needed() -> usize
fn read_from_buffer_with_ctx( context: C, buffer: &'a [u8], ) -> Result<Self, <C as Context>::Error>
fn read_with_length_from_buffer_with_ctx( context: C, buffer: &'a [u8], ) -> (Result<Self, <C as Context>::Error>, usize)
fn read_from_buffer_copying_data_with_ctx( context: C, buffer: &[u8], ) -> Result<Self, <C as Context>::Error>
fn read_with_length_from_buffer_copying_data_with_ctx( context: C, buffer: &[u8], ) -> (Result<Self, <C as Context>::Error>, usize)
fn read_with_length_from_buffer_copying_data_with_ctx_mut( context: &mut C, buffer: &[u8], ) -> (Result<Self, <C as Context>::Error>, usize)
fn read_from_stream_unbuffered_with_ctx<S>(
context: C,
stream: S,
) -> Result<Self, <C as Context>::Error>where
S: Read,
fn read_from_stream_buffered_with_ctx<S>(
context: C,
stream: S,
) -> Result<Self, <C as Context>::Error>where
S: Read,
fn read_from_file_with_ctx( context: C, path: impl AsRef<Path>, ) -> Result<Self, <C as Context>::Error>
source§impl TryFrom<SignatureHex> for Signature
impl TryFrom<SignatureHex> for Signature
source§impl<C: Context> Writable<C> for Signature
impl<C: Context> Writable<C> for Signature
fn write_to<T: ?Sized + Writer<C>>( &self, writer: &mut T, ) -> Result<(), C::Error>
fn bytes_needed(&self) -> Result<usize, C::Error>
fn write_to_buffer_with_ctx( &self, context: C, buffer: &mut [u8], ) -> Result<(), <C as Context>::Error>
fn write_to_buffer_with_ctx_mut( &self, context: &mut C, buffer: &mut [u8], ) -> Result<(), <C as Context>::Error>
fn write_to_vec_with_ctx( &self, context: C, ) -> Result<Vec<u8>, <C as Context>::Error>
fn write_to_vec_with_ctx_mut( &self, context: &mut C, ) -> Result<Vec<u8>, <C as Context>::Error>
fn write_to_stream_with_ctx<S>(
&self,
context: C,
stream: S,
) -> Result<(), <C as Context>::Error>where
S: Write,
fn write_to_file_with_ctx( &self, context: C, path: impl AsRef<Path>, ) -> Result<(), <C as Context>::Error>
impl Copy for Signature
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
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