pub enum PublicId {
Node(PublicId),
Client(PublicId),
}Expand description
An enum representing the identity of a network Node or Client.
It includes public signing key(s), and provides the entity’s network address, i.e. its name().
Variants§
Node(PublicId)
The public identity of a network Node.
Client(PublicId)
The public identity of a network Client.
Implementations§
Source§impl PublicId
impl PublicId
Sourcepub fn node_public_id(&self) -> Option<&PublicId>
pub fn node_public_id(&self) -> Option<&PublicId>
Returns the node public id, if applicable.
Sourcepub fn client_public_id(&self) -> Option<&PublicId>
pub fn client_public_id(&self) -> Option<&PublicId>
Returns the client public id, if applicable.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Returns the entity’s public key, if applicable.
Sourcepub fn encode_to_zbase32(&self) -> String
pub fn encode_to_zbase32(&self) -> String
Returns the PublicId serialised and encoded in z-base-32.
Sourcepub fn decode_from_zbase32<T: AsRef<str>>(encoded: T) -> Result<Self>
pub fn decode_from_zbase32<T: AsRef<str>>(encoded: T) -> Result<Self>
Creates from z-base-32 encoded string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicId
impl<'de> Deserialize<'de> for PublicId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for PublicId
impl Ord for PublicId
Source§impl PartialOrd for PublicId
impl PartialOrd for PublicId
impl Eq for PublicId
impl StructuralPartialEq for PublicId
Auto Trait Implementations§
impl Freeze for PublicId
impl RefUnwindSafe for PublicId
impl Send for PublicId
impl Sync for PublicId
impl Unpin for PublicId
impl UnwindSafe for PublicId
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> 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 more