pub struct I2pDestination { /* private fields */ }Expand description
An I2P destination address (~516 bytes, Base64-encoded for display/storage).
This is the I2P equivalent of a SocketAddr. Peers are identified by their
destination rather than by IP:port.
Implementations§
Source§impl I2pDestination
impl I2pDestination
Sourcepub fn from_bytes(bytes: Vec<u8>) -> I2pDestination
pub fn from_bytes(bytes: Vec<u8>) -> I2pDestination
Create from raw bytes.
Sourcepub fn from_base64(s: &str) -> Result<I2pDestination, I2pDestinationError>
pub fn from_base64(s: &str) -> Result<I2pDestination, I2pDestinationError>
Sourcepub fn to_b32_address(&self) -> String
pub fn to_b32_address(&self) -> String
Compute the 52-character Base32 hash used in .b32.i2p addresses.
This is SHA-256 of the destination bytes, encoded as Base32 (lowercase, no padding). The result is 52 characters.
Trait Implementations§
Source§impl Clone for I2pDestination
impl Clone for I2pDestination
Source§fn clone(&self) -> I2pDestination
fn clone(&self) -> I2pDestination
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 I2pDestination
impl Debug for I2pDestination
Source§impl<'de> Deserialize<'de> for I2pDestination
impl<'de> Deserialize<'de> for I2pDestination
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<I2pDestination, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<I2pDestination, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for I2pDestination
impl Display for I2pDestination
Source§impl Hash for I2pDestination
impl Hash for I2pDestination
Source§impl PartialEq for I2pDestination
impl PartialEq for I2pDestination
Source§fn eq(&self, other: &I2pDestination) -> bool
fn eq(&self, other: &I2pDestination) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for I2pDestination
impl Serialize for I2pDestination
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for I2pDestination
impl StructuralPartialEq for I2pDestination
Auto Trait Implementations§
impl Freeze for I2pDestination
impl RefUnwindSafe for I2pDestination
impl Send for I2pDestination
impl Sync for I2pDestination
impl Unpin for I2pDestination
impl UnsafeUnpin for I2pDestination
impl UnwindSafe for I2pDestination
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.