refactor: Start using UniFFI proc-macro frontend

This commit is contained in:
Jonas Platte
2022-07-27 16:11:03 +02:00
committed by Jonas Platte
parent 5faed2e635
commit f83292fc75
3 changed files with 7 additions and 8 deletions

View File

@@ -1,9 +1,6 @@
namespace sdk {
void setup_tracing(string configuration);
MediaSource media_source_from_url(string url);
MessageEventContent message_event_content_from_markdown(string md);
string gen_transaction_id();
};
[Error]
@@ -179,15 +176,15 @@ interface HomeserverLoginDetails {
interface AuthenticationService {
constructor(string base_path);
HomeserverLoginDetails? homeserver_details();
[Throws=AuthenticationError]
void configure_homeserver(string server_name);
[Throws=AuthenticationError]
Client login(string username, string password);
[Throws=AuthenticationError]
Client restore_with_access_token(string token, string device_id);
};

View File

@@ -262,6 +262,7 @@ impl Client {
}
}
pub fn gen_transaction_id() -> String {
#[uniffi::export]
fn gen_transaction_id() -> String {
TransactionId::new().to_string()
}

View File

@@ -57,6 +57,7 @@ impl From<anyhow::Error> for ClientError {
}
}
#[uniffi::export]
fn setup_tracing(configuration: String) {
tracing_subscriber::registry()
.with(EnvFilter::new(configuration))