matrix_sdk_ffi/
element.rs

1use serde::Deserialize;
2
3use crate::ClientError;
4
5/// Well-known settings specific to ElementCall
6#[derive(Deserialize, uniffi::Record)]
7pub struct ElementCallWellKnown {
8    widget_url: String,
9}
10
11/// Element specific well-known settings
12#[derive(Deserialize, uniffi::Record)]
13pub struct ElementWellKnown {
14    call: Option<ElementCallWellKnown>,
15    registration_helper_url: Option<String>,
16}
17
18/// Helper function to parse a string into a ElementWellKnown struct
19#[matrix_sdk_ffi_macros::export]
20pub fn make_element_well_known(string: String) -> Result<ElementWellKnown, ClientError> {
21    serde_json::from_str(&string).map_err(ClientError::new)
22}