Enum ServiceId
pub enum ServiceId {
Aci(SpecificServiceId<libsignal_core::::address::Aci::{constant#0}>),
Pni(SpecificServiceId<libsignal_core::::address::Pni::{constant#0}>),
}
Expand description
A Signal service ID, which can be one of various types.
Conceptually this is a UUID in a particular “namespace” representing a particular way to reach a user on the Signal service.
Variants§
Aci(SpecificServiceId<libsignal_core::::address::Aci::{constant#0}>)
An ACI
Pni(SpecificServiceId<libsignal_core::::address::Pni::{constant#0}>)
A PNI
Implementations§
§impl ServiceId
impl ServiceId
pub fn kind(&self) -> ServiceIdKind
pub fn kind(&self) -> ServiceIdKind
The kind of service ID self
is.
pub fn service_id_binary(&self) -> Vec<u8> ⓘ
pub fn service_id_binary(&self) -> Vec<u8> ⓘ
The standard variable-width binary representation for a Signal service ID.
This format is not self-delimiting; the length is needed to decode it.
pub fn service_id_fixed_width_binary(&self) -> [u8; 17]
pub fn service_id_fixed_width_binary(&self) -> [u8; 17]
The standard fixed-width binary representation for a Signal service ID.
pub fn service_id_string(&self) -> String
pub fn service_id_string(&self) -> String
The standard string representation for a Signal service ID.
pub fn parse_from_service_id_binary(bytes: &[u8]) -> Option<ServiceId>
pub fn parse_from_service_id_binary(bytes: &[u8]) -> Option<ServiceId>
Parses from the standard binary representation, returning None
if invalid.
pub fn parse_from_service_id_fixed_width_binary(
bytes: &[u8; 17],
) -> Option<ServiceId>
pub fn parse_from_service_id_fixed_width_binary( bytes: &[u8; 17], ) -> Option<ServiceId>
Parses from the standard binary representation, returning None
if invalid.
pub fn parse_from_service_id_string(input: &str) -> Option<ServiceId>
pub fn parse_from_service_id_string(input: &str) -> Option<ServiceId>
Parses from the standard String representation, returning None
if invalid.
The UUID parsing is case-insensitive.
Trait Implementations§
§impl Ord for ServiceId
impl Ord for ServiceId
§impl PartialOrd for ServiceId
impl PartialOrd for ServiceId
impl Copy for ServiceId
impl Eq for ServiceId
impl StructuralPartialEq for ServiceId
Auto Trait Implementations§
impl Freeze for ServiceId
impl RefUnwindSafe for ServiceId
impl Send for ServiceId
impl Sync for ServiceId
impl Unpin for ServiceId
impl UnwindSafe for ServiceId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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>
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>
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