pub struct Ed25519PublicKey(/* private fields */);Expand description
A 32-byte Ed25519 public key.
Serializes as a hex string for JSON compatibility. Enforces exactly 32 bytes at construction time.
Implementations§
Source§impl Ed25519PublicKey
impl Ed25519PublicKey
Sourcepub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn from_bytes(bytes: [u8; 32]) -> Self
Creates a new Ed25519PublicKey from a 32-byte array.
Sourcepub fn try_from_slice(slice: &[u8]) -> Result<Self, Ed25519KeyError>
pub fn try_from_slice(slice: &[u8]) -> Result<Self, Ed25519KeyError>
Creates a new Ed25519PublicKey from a byte slice.
Args:
slice: Byte slice that must be exactly 32 bytes.
Usage:
ⓘ
let pk = Ed25519PublicKey::try_from_slice(&bytes)?;Trait Implementations§
Source§impl AsRef<[u8]> for Ed25519PublicKey
impl AsRef<[u8]> for Ed25519PublicKey
Source§impl Clone for Ed25519PublicKey
impl Clone for Ed25519PublicKey
Source§fn clone(&self) -> Ed25519PublicKey
fn clone(&self) -> Ed25519PublicKey
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 Ed25519PublicKey
impl Debug for Ed25519PublicKey
Source§impl<'de> Deserialize<'de> for Ed25519PublicKey
impl<'de> Deserialize<'de> for Ed25519PublicKey
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Ed25519PublicKey
impl Display for Ed25519PublicKey
Source§impl Hash for Ed25519PublicKey
impl Hash for Ed25519PublicKey
Source§impl PartialEq for Ed25519PublicKey
impl PartialEq for Ed25519PublicKey
Source§impl Serialize for Ed25519PublicKey
impl Serialize for Ed25519PublicKey
impl Copy for Ed25519PublicKey
impl Eq for Ed25519PublicKey
impl StructuralPartialEq for Ed25519PublicKey
Auto Trait Implementations§
impl Freeze for Ed25519PublicKey
impl RefUnwindSafe for Ed25519PublicKey
impl Send for Ed25519PublicKey
impl Sync for Ed25519PublicKey
impl Unpin for Ed25519PublicKey
impl UnsafeUnpin for Ed25519PublicKey
impl UnwindSafe for Ed25519PublicKey
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<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)