pub struct DeviceId(/* private fields */);Expand description
A Matrix key ID.
Device identifiers in Matrix are completely opaque character sequences. This type is provided simply for its semantic value.
§Example
use ruma_identifiers::{device_id, DeviceId};
let random_id = DeviceId::new();
assert_eq!(random_id.as_str().len(), 8);
let static_id = device_id!("01234567");
assert_eq!(static_id.as_str(), "01234567");
let ref_id: &DeviceId = "abcdefghi".into();
assert_eq!(ref_id.as_str(), "abcdefghi");
let owned_id: Box<DeviceId> = "ijklmnop".into();
assert_eq!(owned_id.as_str(), "ijklmnop");Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Box<DeviceId>
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Box<DeviceId>
Available on crate feature
serde only.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