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>
1.0.0 · 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 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<&str> for Base64PublicKeyOrDeviceId
impl PartialEq<&str> for Base64PublicKeyOrDeviceId
Source§impl PartialEq<Base64PublicKeyOrDeviceId> for &str
impl PartialEq<Base64PublicKeyOrDeviceId> for &str
Source§impl PartialEq<Base64PublicKeyOrDeviceId> for String
impl PartialEq<Base64PublicKeyOrDeviceId> for String
Source§impl PartialEq<Base64PublicKeyOrDeviceId> for str
impl PartialEq<Base64PublicKeyOrDeviceId> for str
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
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
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl PartialEq<OwnedBase64PublicKeyOrDeviceId> for Box<Base64PublicKeyOrDeviceId>
impl PartialEq<OwnedBase64PublicKeyOrDeviceId> for Box<Base64PublicKeyOrDeviceId>
Source§fn eq(&self, other: &OwnedBase64PublicKeyOrDeviceId) -> bool
fn eq(&self, other: &OwnedBase64PublicKeyOrDeviceId) -> bool
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 PartialOrd for Base64PublicKeyOrDeviceId
impl PartialOrd for Base64PublicKeyOrDeviceId
Source§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
Source§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.