mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-08 17:27:44 +03:00
24 lines
556 B
Rust
24 lines
556 B
Rust
|
use std::collections::HashMap;
|
||
|
|
||
|
use matrix_sdk_crypto::Device as InnerDevice;
|
||
|
|
||
|
pub struct Device {
|
||
|
pub user_id: String,
|
||
|
pub device_id: String,
|
||
|
pub keys: HashMap<String, String>,
|
||
|
}
|
||
|
|
||
|
impl From<InnerDevice> for Device {
|
||
|
fn from(d: InnerDevice) -> Self {
|
||
|
Device {
|
||
|
user_id: d.user_id().to_string(),
|
||
|
device_id: d.device_id().to_string(),
|
||
|
keys: d
|
||
|
.keys()
|
||
|
.iter()
|
||
|
.map(|(k, v)| (k.to_string(), v.to_string()))
|
||
|
.collect(),
|
||
|
}
|
||
|
}
|
||
|
}
|