bindings: Use proc-macros for types no longer referenced in UDL

This commit is contained in:
Jonas Platte
2023-04-27 14:47:11 +02:00
committed by Jonas Platte
parent 34d2a20b15
commit b4faef7867
5 changed files with 4 additions and 25 deletions

View File

@@ -42,7 +42,8 @@ pub enum SignatureError {
UnknownUserIdentity(String),
}
#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
#[uniffi(flat_error)]
pub enum CryptoStoreError {
#[error("Failed to open the store")]
OpenStore(#[from] OpenStoreError),

View File

@@ -8,16 +8,6 @@ callback interface ProgressListener {
void on_progress(i32 progress, i32 total);
};
[Error]
enum CryptoStoreError {
"OpenStore",
"CryptoStore",
"OlmError",
"Serialization",
"InvalidUserId",
"Identifier",
};
dictionary CancelInfo {
string cancel_code;
string reason;

View File

@@ -1,10 +1,5 @@
namespace matrix_sdk_ffi {};
[Error]
interface ClientError {
Generic(string msg);
};
callback interface ClientDelegate {
void did_receive_auth_error(boolean is_soft_logout);
};
@@ -166,11 +161,3 @@ callback interface SessionVerificationControllerDelegate {
void did_cancel();
void did_finish();
};
enum LogLevel {
"Error",
"Warn",
"Info",
"Debug",
"Trace",
};

View File

@@ -1,6 +1,6 @@
use matrix_sdk::{self, encryption::CryptoStoreError, HttpError, IdParseError, StoreError};
#[derive(thiserror::Error, Debug)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum ClientError {
#[error("client error: {msg}")]
Generic { msg: String },

View File

@@ -170,6 +170,7 @@ impl Span {
}
}
#[derive(uniffi::Enum)]
pub enum LogLevel {
Error,
Warn,