pub struct V3OnionServiceId { /* private fields */ }Expand description
A v3 onion-service id
Implementations§
Source§impl V3OnionServiceId
Strongly-typed representation of a v3 onion-service id
 
impl V3OnionServiceId
Strongly-typed representation of a v3 onion-service id
Sourcepub fn from_string(service_id: &str) -> Result<V3OnionServiceId, Error>
 
pub fn from_string(service_id: &str) -> Result<V3OnionServiceId, Error>
Create a V3OnionServiceId from a String in the version 3 onion service digest format. From the tor address specification:
onion_address = base32(PUBKEY | CHECKSUM | VERSION) CHECKSUM = H(".onion checksum" | PUBKEY | VERSION)[:2] where: - PUBKEY is the 32 bytes ed25519 master pubkey of the onion service. - VERSION is a one byte version field (default value '\x03') - ".onion checksum" is a constant string - H is SHA3-256 - CHECKSUM is truncated to two bytes before inserting it in onion_address
Sourcepub fn from_public_key(public_key: &Ed25519PublicKey) -> V3OnionServiceId
 
pub fn from_public_key(public_key: &Ed25519PublicKey) -> V3OnionServiceId
Create a V3OnionServiceId from an Ed25519PublicKey.
Sourcepub fn from_private_key(private_key: &Ed25519PrivateKey) -> V3OnionServiceId
 
pub fn from_private_key(private_key: &Ed25519PrivateKey) -> V3OnionServiceId
Create a V3OnionServiceId from an Ed25519PrivateKey.
Trait Implementations§
Source§impl Clone for V3OnionServiceId
 
impl Clone for V3OnionServiceId
Source§fn clone(&self) -> V3OnionServiceId
 
fn clone(&self) -> V3OnionServiceId
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 V3OnionServiceId
 
impl Debug for V3OnionServiceId
Source§impl Display for V3OnionServiceId
 
impl Display for V3OnionServiceId
Source§impl Hash for V3OnionServiceId
 
impl Hash for V3OnionServiceId
Source§impl Ord for V3OnionServiceId
 
impl Ord for V3OnionServiceId
Source§fn cmp(&self, other: &V3OnionServiceId) -> Ordering
 
fn cmp(&self, other: &V3OnionServiceId) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for V3OnionServiceId
 
impl PartialEq for V3OnionServiceId
Source§impl PartialOrd for V3OnionServiceId
 
impl PartialOrd for V3OnionServiceId
impl Eq for V3OnionServiceId
impl StructuralPartialEq for V3OnionServiceId
Auto Trait Implementations§
impl Freeze for V3OnionServiceId
impl RefUnwindSafe for V3OnionServiceId
impl Send for V3OnionServiceId
impl Sync for V3OnionServiceId
impl Unpin for V3OnionServiceId
impl UnwindSafe for V3OnionServiceId
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
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> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<Source, Target> OctetsInto<Target> for Sourcewhere
    Target: OctetsFrom<Source>,
 
impl<Source, Target> OctetsInto<Target> for Sourcewhere
    Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
    self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
 
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
Source§fn octets_into(self) -> Target
 
fn octets_into(self) -> Target
Performs an infallible conversion.