Enum libsignal_protocol::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<const KIND: u8> PartialEq<SpecificServiceId<KIND>> for ServiceId
impl<const KIND: u8> PartialEq<SpecificServiceId<KIND>> for ServiceId
§impl PartialOrd for ServiceId
impl PartialOrd for ServiceId
§fn partial_cmp(&self, other: &ServiceId) -> Option<Ordering>
fn partial_cmp(&self, other: &ServiceId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl 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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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