Struct ruma_common::DeviceKeyId
source · pub struct DeviceKeyId(/* private fields */);
Expand description
A key algorithm and a device id, combined with a ‘:’.
Implementations§
source§impl DeviceKeyId
impl DeviceKeyId
source§impl DeviceKeyId
impl DeviceKeyId
sourcepub fn parse(s: impl AsRef<str>) -> Result<OwnedDeviceKeyId, IdParseError>
pub fn parse(s: impl AsRef<str>) -> Result<OwnedDeviceKeyId, IdParseError>
Try parsing a &str
into an OwnedDeviceKeyId
.
The same can also be done using FromStr
, TryFrom
or TryInto
.
This function is simply more constrained and thus useful in generic contexts.
sourcepub fn parse_box(
s: impl AsRef<str> + Into<Box<str>>,
) -> Result<Box<Self>, IdParseError>
pub fn parse_box( s: impl AsRef<str> + Into<Box<str>>, ) -> Result<Box<Self>, IdParseError>
Try parsing a &str
into a Box<DeviceKeyId>
.
The same can also be done using FromStr
, TryFrom
or TryInto
.
This function is simply more constrained and thus useful in generic contexts.
source§impl DeviceKeyId
impl DeviceKeyId
sourcepub fn from_parts(
algorithm: DeviceKeyAlgorithm,
device_id: &DeviceId,
) -> OwnedDeviceKeyId
pub fn from_parts( algorithm: DeviceKeyAlgorithm, device_id: &DeviceId, ) -> OwnedDeviceKeyId
Create a DeviceKeyId
from a DeviceKeyAlgorithm
and a DeviceId
.
sourcepub fn algorithm(&self) -> DeviceKeyAlgorithm
pub fn algorithm(&self) -> DeviceKeyAlgorithm
Returns key algorithm of the device key ID.
Trait Implementations§
source§impl AsRef<[u8]> for DeviceKeyId
impl AsRef<[u8]> for DeviceKeyId
source§impl AsRef<DeviceKeyId> for DeviceKeyId
impl AsRef<DeviceKeyId> for DeviceKeyId
source§fn as_ref(&self) -> &DeviceKeyId
fn as_ref(&self) -> &DeviceKeyId
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<DeviceKeyId> for OwnedDeviceKeyId
impl AsRef<DeviceKeyId> for OwnedDeviceKeyId
source§fn as_ref(&self) -> &DeviceKeyId
fn as_ref(&self) -> &DeviceKeyId
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<str> for DeviceKeyId
impl AsRef<str> for DeviceKeyId
source§impl Borrow<DeviceKeyId> for OwnedDeviceKeyId
impl Borrow<DeviceKeyId> for OwnedDeviceKeyId
source§fn borrow(&self) -> &DeviceKeyId
fn borrow(&self) -> &DeviceKeyId
Immutably borrows from an owned value. Read more
source§impl Clone for Box<DeviceKeyId>
impl Clone for Box<DeviceKeyId>
source§impl Debug for DeviceKeyId
impl Debug for DeviceKeyId
source§impl<'de> Deserialize<'de> for Box<DeviceKeyId>
impl<'de> Deserialize<'de> for Box<DeviceKeyId>
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 Display for DeviceKeyId
impl Display for DeviceKeyId
source§impl From<&DeviceKeyId> for Arc<DeviceKeyId>
impl From<&DeviceKeyId> for Arc<DeviceKeyId>
source§fn from(s: &DeviceKeyId) -> Arc<DeviceKeyId>
fn from(s: &DeviceKeyId) -> Arc<DeviceKeyId>
Converts to this type from the input type.
source§impl From<&DeviceKeyId> for Box<DeviceKeyId>
impl From<&DeviceKeyId> for Box<DeviceKeyId>
source§fn from(id: &DeviceKeyId) -> Self
fn from(id: &DeviceKeyId) -> Self
Converts to this type from the input type.
source§impl From<&DeviceKeyId> for OwnedDeviceKeyId
impl From<&DeviceKeyId> for OwnedDeviceKeyId
source§fn from(id: &DeviceKeyId) -> OwnedDeviceKeyId
fn from(id: &DeviceKeyId) -> OwnedDeviceKeyId
Converts to this type from the input type.
source§impl From<&DeviceKeyId> for Rc<DeviceKeyId>
impl From<&DeviceKeyId> for Rc<DeviceKeyId>
source§fn from(s: &DeviceKeyId) -> Rc<DeviceKeyId>
fn from(s: &DeviceKeyId) -> Rc<DeviceKeyId>
Converts to this type from the input type.
source§impl From<&DeviceKeyId> for String
impl From<&DeviceKeyId> for String
source§fn from(id: &DeviceKeyId) -> Self
fn from(id: &DeviceKeyId) -> Self
Converts to this type from the input type.
source§impl From<OwnedDeviceKeyId> for Box<DeviceKeyId>
impl From<OwnedDeviceKeyId> for Box<DeviceKeyId>
source§fn from(a: OwnedDeviceKeyId) -> Box<DeviceKeyId>
fn from(a: OwnedDeviceKeyId) -> Box<DeviceKeyId>
Converts to this type from the input type.
source§impl FromStr for Box<DeviceKeyId>
impl FromStr for Box<DeviceKeyId>
source§impl Hash for DeviceKeyId
impl Hash for DeviceKeyId
source§impl Ord for DeviceKeyId
impl Ord for DeviceKeyId
source§impl PartialEq<&DeviceKeyId> for Box<DeviceKeyId>
impl PartialEq<&DeviceKeyId> for Box<DeviceKeyId>
source§fn eq(&self, other: &&DeviceKeyId) -> bool
fn eq(&self, other: &&DeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<&DeviceKeyId> for OwnedDeviceKeyId
impl PartialEq<&DeviceKeyId> for OwnedDeviceKeyId
source§fn eq(&self, other: &&DeviceKeyId) -> bool
fn eq(&self, other: &&DeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<&str> for Box<DeviceKeyId>
impl PartialEq<&str> for Box<DeviceKeyId>
source§impl PartialEq<&str> for DeviceKeyId
impl PartialEq<&str> for DeviceKeyId
source§impl PartialEq<Box<DeviceKeyId>> for &DeviceKeyId
impl PartialEq<Box<DeviceKeyId>> for &DeviceKeyId
source§impl PartialEq<Box<DeviceKeyId>> for DeviceKeyId
impl PartialEq<Box<DeviceKeyId>> for DeviceKeyId
source§impl PartialEq<DeviceKeyId> for &str
impl PartialEq<DeviceKeyId> for &str
source§fn eq(&self, other: &DeviceKeyId) -> bool
fn eq(&self, other: &DeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<DeviceKeyId> for Box<DeviceKeyId>
impl PartialEq<DeviceKeyId> for Box<DeviceKeyId>
source§fn eq(&self, other: &DeviceKeyId) -> bool
fn eq(&self, other: &DeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<DeviceKeyId> for OwnedDeviceKeyId
impl PartialEq<DeviceKeyId> for OwnedDeviceKeyId
source§fn eq(&self, other: &DeviceKeyId) -> bool
fn eq(&self, other: &DeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<DeviceKeyId> for String
impl PartialEq<DeviceKeyId> for String
source§fn eq(&self, other: &DeviceKeyId) -> bool
fn eq(&self, other: &DeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<DeviceKeyId> for str
impl PartialEq<DeviceKeyId> for str
source§fn eq(&self, other: &DeviceKeyId) -> bool
fn eq(&self, other: &DeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedDeviceKeyId> for &DeviceKeyId
impl PartialEq<OwnedDeviceKeyId> for &DeviceKeyId
source§fn eq(&self, other: &OwnedDeviceKeyId) -> bool
fn eq(&self, other: &OwnedDeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedDeviceKeyId> for Box<DeviceKeyId>
impl PartialEq<OwnedDeviceKeyId> for Box<DeviceKeyId>
source§fn eq(&self, other: &OwnedDeviceKeyId) -> bool
fn eq(&self, other: &OwnedDeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<OwnedDeviceKeyId> for DeviceKeyId
impl PartialEq<OwnedDeviceKeyId> for DeviceKeyId
source§fn eq(&self, other: &OwnedDeviceKeyId) -> bool
fn eq(&self, other: &OwnedDeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<String> for Box<DeviceKeyId>
impl PartialEq<String> for Box<DeviceKeyId>
source§impl PartialEq<String> for DeviceKeyId
impl PartialEq<String> for DeviceKeyId
source§impl PartialEq<str> for DeviceKeyId
impl PartialEq<str> for DeviceKeyId
source§impl PartialEq for DeviceKeyId
impl PartialEq for DeviceKeyId
source§fn eq(&self, other: &DeviceKeyId) -> bool
fn eq(&self, other: &DeviceKeyId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for DeviceKeyId
impl PartialOrd for DeviceKeyId
source§fn partial_cmp(&self, other: &DeviceKeyId) -> Option<Ordering>
fn partial_cmp(&self, other: &DeviceKeyId) -> 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 DeviceKeyId
impl Serialize for DeviceKeyId
source§impl ToOwned for DeviceKeyId
impl ToOwned for DeviceKeyId
§type Owned = OwnedDeviceKeyId
type Owned = OwnedDeviceKeyId
The resulting type after obtaining ownership.
source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::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
source§impl<'a> TryFrom<&'a str> for &'a DeviceKeyId
impl<'a> TryFrom<&'a str> for &'a DeviceKeyId
impl Eq for DeviceKeyId
impl StructuralPartialEq for DeviceKeyId
Auto Trait Implementations§
impl Freeze for DeviceKeyId
impl RefUnwindSafe for DeviceKeyId
impl Send for DeviceKeyId
impl !Sized for DeviceKeyId
impl Sync for DeviceKeyId
impl Unpin for DeviceKeyId
impl UnwindSafe for DeviceKeyId
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.