xrpl_common_stdlib/types/signature.rs
1//! A signature being verified against a message and public key.
2
3/// A signature checked by [`check_sig`](crate::crypto::check_sig).
4///
5/// This is a thin, zero-copy newtype around a byte slice. Its only purpose is to give the
6/// signature argument a distinct type from the message argument (see [`Message`]), so a
7/// caller who swaps the two is caught at compile time rather than silently getting a wrong
8/// answer at runtime.
9///
10/// [`Message`]: crate::types::message::Message
11///
12/// ## Derived Traits
13///
14/// - `Copy`: the newtype only borrows a slice, so copying is trivial
15/// - `PartialEq, Eq`: enable comparisons
16/// - `Debug, Clone`: standard traits for development and consistency
17#[derive(Debug, Clone, Copy, PartialEq, Eq)]
18pub struct Signature<'a>(pub &'a [u8]);