pub struct Ed25519Identity(/* private fields */);Expand description
A validated Ed25519 identity.
Ed25519 identities are 32-byte values that uniquely identify relays in the modern Tor network. This type ensures the identity is valid at construction time.
§Example
use stem_rs::types::Ed25519Identity;
let bytes = [99u8; 32];
let identity = Ed25519Identity::new(bytes);
let base64 = identity.to_base64();
let decoded = Ed25519Identity::from_base64(&base64).unwrap();
assert_eq!(identity, decoded);Implementations§
Source§impl Ed25519Identity
impl Ed25519Identity
Sourcepub fn from_base64(s: &str) -> Result<Self, Ed25519IdentityError>
pub fn from_base64(s: &str) -> Result<Self, Ed25519IdentityError>
Creates a new Ed25519 identity from base64-encoded string.
§Errors
Returns an error if the base64 is invalid or decodes to wrong length.
Trait Implementations§
Source§impl Clone for Ed25519Identity
impl Clone for Ed25519Identity
Source§fn clone(&self) -> Ed25519Identity
fn clone(&self) -> Ed25519Identity
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 Ed25519Identity
impl Debug for Ed25519Identity
Source§impl Display for Ed25519Identity
impl Display for Ed25519Identity
Source§impl FromStr for Ed25519Identity
impl FromStr for Ed25519Identity
Source§impl PartialEq for Ed25519Identity
impl PartialEq for Ed25519Identity
impl Eq for Ed25519Identity
impl StructuralPartialEq for Ed25519Identity
Auto Trait Implementations§
impl Freeze for Ed25519Identity
impl RefUnwindSafe for Ed25519Identity
impl Send for Ed25519Identity
impl Sync for Ed25519Identity
impl Unpin for Ed25519Identity
impl UnwindSafe for Ed25519Identity
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