pub struct Ed25519PublicKey(/* private fields */);Expand description
A validated Ed25519 public key.
Ed25519 public keys are 32-byte values used for modern Tor relay identity and signing operations. This type ensures the key is valid at construction time.
§Example
use stem_rs::types::Ed25519PublicKey;
let bytes = [42u8; 32];
let key = Ed25519PublicKey::new(bytes);
let base64 = key.to_base64();
let decoded = Ed25519PublicKey::from_base64(&base64).unwrap();
assert_eq!(key, decoded);Implementations§
Source§impl Ed25519PublicKey
impl Ed25519PublicKey
Sourcepub fn from_base64(s: &str) -> Result<Self, Ed25519PublicKeyError>
pub fn from_base64(s: &str) -> Result<Self, Ed25519PublicKeyError>
Creates a new Ed25519 public key from base64-encoded string.
§Errors
Returns an error if the base64 is invalid or decodes to wrong length.
Trait Implementations§
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 Display for Ed25519PublicKey
impl Display for Ed25519PublicKey
Source§impl FromStr for Ed25519PublicKey
impl FromStr for Ed25519PublicKey
Source§impl PartialEq for Ed25519PublicKey
impl PartialEq 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 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