Struct matrix_sdk_base::ruma::Base64PublicKeyOrDeviceId
source · pub struct Base64PublicKeyOrDeviceId(/* private fields */);
Expand description
A Matrix ID that can be either a DeviceId
or a Base64PublicKey
.
Device identifiers in Matrix are completely opaque character sequences and cross-signing keys are identified by their base64-encoded public key. This type is provided simply for its semantic value.
It is not recommended to construct this type directly, it should instead be converted from a
DeviceId
or a Base64PublicKey
.
§Example
use ruma_common::{Base64PublicKeyOrDeviceId, OwnedBase64PublicKeyOrDeviceId};
let ref_id: &Base64PublicKeyOrDeviceId = "abcdefghi".into();
assert_eq!(ref_id.as_str(), "abcdefghi");
let owned_id: OwnedBase64PublicKeyOrDeviceId = "ijklmnop".into();
assert_eq!(owned_id.as_str(), "ijklmnop");
Implementations§
Trait Implementations§
source§impl AsRef<[u8]> for Base64PublicKeyOrDeviceId
impl AsRef<[u8]> for Base64PublicKeyOrDeviceId
source§impl AsRef<Base64PublicKeyOrDeviceId> for Base64PublicKeyOrDeviceId
impl AsRef<Base64PublicKeyOrDeviceId> for Base64PublicKeyOrDeviceId
source§fn as_ref(&self) -> &Base64PublicKeyOrDeviceId
fn as_ref(&self) -> &Base64PublicKeyOrDeviceId
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
impl AsRef<Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
source§fn as_ref(&self) -> &Base64PublicKeyOrDeviceId
fn as_ref(&self) -> &Base64PublicKeyOrDeviceId
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<str> for Base64PublicKeyOrDeviceId
impl AsRef<str> for Base64PublicKeyOrDeviceId
source§impl Borrow<Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
impl Borrow<Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
source§fn borrow(&self) -> &Base64PublicKeyOrDeviceId
fn borrow(&self) -> &Base64PublicKeyOrDeviceId
Immutably borrows from an owned value. Read more
source§impl Clone for Box<Base64PublicKeyOrDeviceId>
impl Clone for Box<Base64PublicKeyOrDeviceId>
source§impl Debug for Base64PublicKeyOrDeviceId
impl Debug for Base64PublicKeyOrDeviceId
source§impl<'de> Deserialize<'de> for Box<Base64PublicKeyOrDeviceId>
impl<'de> Deserialize<'de> for Box<Base64PublicKeyOrDeviceId>
source§fn deserialize<D>(
deserializer: D,
) -> Result<Box<Base64PublicKeyOrDeviceId>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Box<Base64PublicKeyOrDeviceId>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Base64PublicKeyOrDeviceId
impl Display for Base64PublicKeyOrDeviceId
source§impl<'a> From<&'a Base64PublicKey> for &'a Base64PublicKeyOrDeviceId
impl<'a> From<&'a Base64PublicKey> for &'a Base64PublicKeyOrDeviceId
source§fn from(value: &'a Base64PublicKey) -> &'a Base64PublicKeyOrDeviceId
fn from(value: &'a Base64PublicKey) -> &'a Base64PublicKeyOrDeviceId
Converts to this type from the input type.
source§impl From<&Base64PublicKeyOrDeviceId> for Arc<Base64PublicKeyOrDeviceId>
impl From<&Base64PublicKeyOrDeviceId> for Arc<Base64PublicKeyOrDeviceId>
source§fn from(s: &Base64PublicKeyOrDeviceId) -> Arc<Base64PublicKeyOrDeviceId>
fn from(s: &Base64PublicKeyOrDeviceId) -> Arc<Base64PublicKeyOrDeviceId>
Converts to this type from the input type.
source§impl From<&Base64PublicKeyOrDeviceId> for Box<Base64PublicKeyOrDeviceId>
impl From<&Base64PublicKeyOrDeviceId> for Box<Base64PublicKeyOrDeviceId>
source§fn from(id: &Base64PublicKeyOrDeviceId) -> Box<Base64PublicKeyOrDeviceId>
fn from(id: &Base64PublicKeyOrDeviceId) -> Box<Base64PublicKeyOrDeviceId>
Converts to this type from the input type.
source§impl From<&Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
impl From<&Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
source§fn from(id: &Base64PublicKeyOrDeviceId) -> OwnedBase64PublicKeyOrDeviceId
fn from(id: &Base64PublicKeyOrDeviceId) -> OwnedBase64PublicKeyOrDeviceId
Converts to this type from the input type.
source§impl From<&Base64PublicKeyOrDeviceId> for Rc<Base64PublicKeyOrDeviceId>
impl From<&Base64PublicKeyOrDeviceId> for Rc<Base64PublicKeyOrDeviceId>
source§fn from(s: &Base64PublicKeyOrDeviceId) -> Rc<Base64PublicKeyOrDeviceId>
fn from(s: &Base64PublicKeyOrDeviceId) -> Rc<Base64PublicKeyOrDeviceId>
Converts to this type from the input type.
source§impl From<&Base64PublicKeyOrDeviceId> for String
impl From<&Base64PublicKeyOrDeviceId> for String
source§fn from(id: &Base64PublicKeyOrDeviceId) -> String
fn from(id: &Base64PublicKeyOrDeviceId) -> String
Converts to this type from the input type.
source§impl<'a> From<&'a DeviceId> for &'a Base64PublicKeyOrDeviceId
impl<'a> From<&'a DeviceId> for &'a Base64PublicKeyOrDeviceId
source§fn from(value: &'a DeviceId) -> &'a Base64PublicKeyOrDeviceId
fn from(value: &'a DeviceId) -> &'a Base64PublicKeyOrDeviceId
Converts to this type from the input type.
source§impl<'a> From<&'a str> for &'a Base64PublicKeyOrDeviceId
impl<'a> From<&'a str> for &'a Base64PublicKeyOrDeviceId
source§fn from(s: &'a str) -> &'a Base64PublicKeyOrDeviceId
fn from(s: &'a str) -> &'a Base64PublicKeyOrDeviceId
Converts to this type from the input type.
source§impl From<OwnedBase64PublicKeyOrDeviceId> for Box<Base64PublicKeyOrDeviceId>
impl From<OwnedBase64PublicKeyOrDeviceId> for Box<Base64PublicKeyOrDeviceId>
source§fn from(a: OwnedBase64PublicKeyOrDeviceId) -> Box<Base64PublicKeyOrDeviceId>
fn from(a: OwnedBase64PublicKeyOrDeviceId) -> Box<Base64PublicKeyOrDeviceId>
Converts to this type from the input type.
source§impl Hash for Base64PublicKeyOrDeviceId
impl Hash for Base64PublicKeyOrDeviceId
source§impl KeyName for Base64PublicKeyOrDeviceId
impl KeyName for Base64PublicKeyOrDeviceId
source§impl Ord for Base64PublicKeyOrDeviceId
impl Ord for Base64PublicKeyOrDeviceId
source§impl PartialEq<&Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
impl PartialEq<&Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
source§fn eq(&self, other: &&Base64PublicKeyOrDeviceId) -> bool
fn eq(&self, other: &&Base64PublicKeyOrDeviceId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<&str> for Base64PublicKeyOrDeviceId
impl PartialEq<&str> for Base64PublicKeyOrDeviceId
source§impl PartialEq<Base64PublicKeyOrDeviceId> for &str
impl PartialEq<Base64PublicKeyOrDeviceId> for &str
source§fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
impl PartialEq<Base64PublicKeyOrDeviceId> for OwnedBase64PublicKeyOrDeviceId
source§fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Base64PublicKeyOrDeviceId> for String
impl PartialEq<Base64PublicKeyOrDeviceId> for String
source§fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Base64PublicKeyOrDeviceId> for str
impl PartialEq<Base64PublicKeyOrDeviceId> for str
source§fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Box<Base64PublicKeyOrDeviceId>> for &Base64PublicKeyOrDeviceId
impl PartialEq<Box<Base64PublicKeyOrDeviceId>> for &Base64PublicKeyOrDeviceId
source§impl PartialEq<Box<Base64PublicKeyOrDeviceId>> for Base64PublicKeyOrDeviceId
impl PartialEq<Box<Base64PublicKeyOrDeviceId>> for Base64PublicKeyOrDeviceId
source§impl PartialEq<OwnedBase64PublicKeyOrDeviceId> for &Base64PublicKeyOrDeviceId
impl PartialEq<OwnedBase64PublicKeyOrDeviceId> for &Base64PublicKeyOrDeviceId
source§fn eq(&self, other: &OwnedBase64PublicKeyOrDeviceId) -> bool
fn eq(&self, other: &OwnedBase64PublicKeyOrDeviceId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedBase64PublicKeyOrDeviceId> for Base64PublicKeyOrDeviceId
impl PartialEq<OwnedBase64PublicKeyOrDeviceId> for Base64PublicKeyOrDeviceId
source§fn eq(&self, other: &OwnedBase64PublicKeyOrDeviceId) -> bool
fn eq(&self, other: &OwnedBase64PublicKeyOrDeviceId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<String> for Base64PublicKeyOrDeviceId
impl PartialEq<String> for Base64PublicKeyOrDeviceId
source§impl PartialEq<str> for Base64PublicKeyOrDeviceId
impl PartialEq<str> for Base64PublicKeyOrDeviceId
source§impl PartialEq for Base64PublicKeyOrDeviceId
impl PartialEq for Base64PublicKeyOrDeviceId
source§fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
fn eq(&self, other: &Base64PublicKeyOrDeviceId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Base64PublicKeyOrDeviceId
impl PartialOrd for Base64PublicKeyOrDeviceId
source§fn partial_cmp(&self, other: &Base64PublicKeyOrDeviceId) -> Option<Ordering>
fn partial_cmp(&self, other: &Base64PublicKeyOrDeviceId) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Base64PublicKeyOrDeviceId
impl Serialize for Base64PublicKeyOrDeviceId
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
source§impl ToOwned for Base64PublicKeyOrDeviceId
impl ToOwned for Base64PublicKeyOrDeviceId
§type Owned = OwnedBase64PublicKeyOrDeviceId
type Owned = OwnedBase64PublicKeyOrDeviceId
The resulting type after obtaining ownership.
source§fn to_owned(&self) -> <Base64PublicKeyOrDeviceId as ToOwned>::Owned
fn to_owned(&self) -> <Base64PublicKeyOrDeviceId as ToOwned>::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
impl Eq for Base64PublicKeyOrDeviceId
impl StructuralPartialEq for Base64PublicKeyOrDeviceId
Auto Trait Implementations§
impl Freeze for Base64PublicKeyOrDeviceId
impl RefUnwindSafe for Base64PublicKeyOrDeviceId
impl Send for Base64PublicKeyOrDeviceId
impl !Sized for Base64PublicKeyOrDeviceId
impl Sync for Base64PublicKeyOrDeviceId
impl Unpin for Base64PublicKeyOrDeviceId
impl UnwindSafe for Base64PublicKeyOrDeviceId
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<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.