Struct ruma_common::DeviceKeyId
source · [−]#[repr(transparent)]pub struct DeviceKeyId(_);
Expand description
A key algorithm and a device id, combined with a ‘:’.
Implementations
sourceimpl DeviceKeyId
impl DeviceKeyId
sourceimpl 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.
sourceimpl 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
sourceimpl AsRef<DeviceKeyId> for OwnedDeviceKeyId
impl AsRef<DeviceKeyId> for OwnedDeviceKeyId
sourcefn as_ref(&self) -> &DeviceKeyId
fn as_ref(&self) -> &DeviceKeyId
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl AsRef<str> for DeviceKeyId
impl AsRef<str> for DeviceKeyId
sourceimpl AsRef<str> for Box<DeviceKeyId>
impl AsRef<str> for Box<DeviceKeyId>
sourceimpl Borrow<DeviceKeyId> for OwnedDeviceKeyId
impl Borrow<DeviceKeyId> for OwnedDeviceKeyId
sourcefn borrow(&self) -> &DeviceKeyId
fn borrow(&self) -> &DeviceKeyId
Immutably borrows from an owned value. Read more
sourceimpl Clone for Box<DeviceKeyId>
impl Clone for Box<DeviceKeyId>
sourceimpl Debug for DeviceKeyId
impl Debug for DeviceKeyId
sourceimpl<'de> Deserialize<'de> for Box<DeviceKeyId>
impl<'de> Deserialize<'de> for Box<DeviceKeyId>
sourcefn 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
sourceimpl Display for DeviceKeyId
impl Display for DeviceKeyId
sourceimpl From<&DeviceKeyId> for OwnedDeviceKeyId
impl From<&DeviceKeyId> for OwnedDeviceKeyId
sourcefn from(id: &DeviceKeyId) -> OwnedDeviceKeyId
fn from(id: &DeviceKeyId) -> OwnedDeviceKeyId
Converts to this type from the input type.
sourceimpl From<&DeviceKeyId> for String
impl From<&DeviceKeyId> for String
sourcefn from(id: &DeviceKeyId) -> Self
fn from(id: &DeviceKeyId) -> Self
Converts to this type from the input type.
sourceimpl From<&DeviceKeyId> for Box<DeviceKeyId>
impl From<&DeviceKeyId> for Box<DeviceKeyId>
sourcefn from(id: &DeviceKeyId) -> Self
fn from(id: &DeviceKeyId) -> Self
Converts to this type from the input type.
sourceimpl From<&DeviceKeyId> for Rc<DeviceKeyId>
impl From<&DeviceKeyId> for Rc<DeviceKeyId>
sourcefn from(s: &DeviceKeyId) -> Rc<DeviceKeyId>
fn from(s: &DeviceKeyId) -> Rc<DeviceKeyId>
Converts to this type from the input type.
sourceimpl From<&DeviceKeyId> for Arc<DeviceKeyId>
impl From<&DeviceKeyId> for Arc<DeviceKeyId>
sourcefn from(s: &DeviceKeyId) -> Arc<DeviceKeyId>
fn from(s: &DeviceKeyId) -> Arc<DeviceKeyId>
Converts to this type from the input type.
sourceimpl FromStr for Box<DeviceKeyId>
impl FromStr for Box<DeviceKeyId>
sourceimpl Hash for DeviceKeyId
impl Hash for DeviceKeyId
sourceimpl Ord for DeviceKeyId
impl Ord for DeviceKeyId
sourceimpl PartialEq<&DeviceKeyId> for OwnedDeviceKeyId
impl PartialEq<&DeviceKeyId> for OwnedDeviceKeyId
sourceimpl PartialEq<&DeviceKeyId> for Box<DeviceKeyId>
impl PartialEq<&DeviceKeyId> for Box<DeviceKeyId>
sourceimpl PartialEq<&str> for DeviceKeyId
impl PartialEq<&str> for DeviceKeyId
sourceimpl PartialEq<&str> for Box<DeviceKeyId>
impl PartialEq<&str> for Box<DeviceKeyId>
sourceimpl PartialEq<Box<DeviceKeyId, Global>> for DeviceKeyId
impl PartialEq<Box<DeviceKeyId, Global>> for DeviceKeyId
sourceimpl PartialEq<Box<DeviceKeyId, Global>> for &DeviceKeyId
impl PartialEq<Box<DeviceKeyId, Global>> for &DeviceKeyId
sourceimpl PartialEq<DeviceKeyId> for DeviceKeyId
impl PartialEq<DeviceKeyId> for DeviceKeyId
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &DeviceKeyId) -> bool
fn ne(&self, other: &DeviceKeyId) -> bool
This method tests for !=
.
sourceimpl PartialEq<DeviceKeyId> for OwnedDeviceKeyId
impl PartialEq<DeviceKeyId> for OwnedDeviceKeyId
sourceimpl PartialEq<DeviceKeyId> for Box<DeviceKeyId>
impl PartialEq<DeviceKeyId> for Box<DeviceKeyId>
sourceimpl PartialEq<DeviceKeyId> for str
impl PartialEq<DeviceKeyId> for str
sourceimpl PartialEq<DeviceKeyId> for &str
impl PartialEq<DeviceKeyId> for &str
sourceimpl PartialEq<DeviceKeyId> for String
impl PartialEq<DeviceKeyId> for String
sourceimpl PartialEq<OwnedDeviceKeyId> for DeviceKeyId
impl PartialEq<OwnedDeviceKeyId> for DeviceKeyId
sourceimpl PartialEq<OwnedDeviceKeyId> for &DeviceKeyId
impl PartialEq<OwnedDeviceKeyId> for &DeviceKeyId
sourceimpl PartialEq<OwnedDeviceKeyId> for Box<DeviceKeyId>
impl PartialEq<OwnedDeviceKeyId> for Box<DeviceKeyId>
sourceimpl PartialEq<String> for DeviceKeyId
impl PartialEq<String> for DeviceKeyId
sourceimpl PartialEq<String> for Box<DeviceKeyId>
impl PartialEq<String> for Box<DeviceKeyId>
sourceimpl PartialEq<str> for DeviceKeyId
impl PartialEq<str> for DeviceKeyId
sourceimpl PartialEq<str> for Box<DeviceKeyId>
impl PartialEq<str> for Box<DeviceKeyId>
sourceimpl PartialOrd<DeviceKeyId> for DeviceKeyId
impl PartialOrd<DeviceKeyId> for DeviceKeyId
sourcefn partial_cmp(&self, other: &DeviceKeyId) -> Option<Ordering>
fn partial_cmp(&self, other: &DeviceKeyId) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Serialize for DeviceKeyId
impl Serialize for DeviceKeyId
sourceimpl ToOwned for DeviceKeyId
impl ToOwned for DeviceKeyId
type Owned = OwnedDeviceKeyId
type Owned = OwnedDeviceKeyId
The resulting type after obtaining ownership.
sourcefn 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 · sourcefn 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
sourceimpl<'a> TryFrom<&'a str> for &'a DeviceKeyId
impl<'a> TryFrom<&'a str> for &'a DeviceKeyId
sourceimpl TryFrom<&str> for Box<DeviceKeyId>
impl TryFrom<&str> for Box<DeviceKeyId>
sourceimpl TryFrom<String> for Box<DeviceKeyId>
impl TryFrom<String> for Box<DeviceKeyId>
impl Eq for DeviceKeyId
impl StructuralEq for DeviceKeyId
impl StructuralPartialEq for DeviceKeyId
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.