@@ -30,12 +30,12 @@ impl mls_rs_core::group::EpochRecord for EpochRecord {
30
30
31
31
#[ cfg_attr( not( mls_build_async) , maybe_async:: must_be_sync) ]
32
32
#[ cfg_attr( mls_build_async, maybe_async:: must_be_async) ]
33
- #[ uniffi:: export]
33
+ #[ uniffi:: export( with_foreign ) ]
34
34
pub trait GroupStateStorage : Send + Sync + Debug {
35
- async fn state ( & self , group_id : & [ u8 ] ) -> Result < Option < Vec < u8 > > , FFICallbackError > ;
35
+ async fn state ( & self , group_id : Vec < u8 > ) -> Result < Option < Vec < u8 > > , FFICallbackError > ;
36
36
async fn epoch (
37
37
& self ,
38
- group_id : & [ u8 ] ,
38
+ group_id : Vec < u8 > ,
39
39
epoch_id : u64 ,
40
40
) -> Result < Option < Vec < u8 > > , FFICallbackError > ;
41
41
@@ -46,7 +46,7 @@ pub trait GroupStateStorage: Send + Sync + Debug {
46
46
epoch_updates : Vec < Arc < EpochRecord > > ,
47
47
) -> Result < ( ) , FFICallbackError > ;
48
48
49
- async fn max_epoch_id ( & self , group_id : & [ u8 ] ) -> Result < Option < u64 > , FFICallbackError > ;
49
+ async fn max_epoch_id ( & self , group_id : Vec < u8 > ) -> Result < Option < u64 > , FFICallbackError > ;
50
50
}
51
51
52
52
#[ derive( Debug , Clone ) ]
@@ -67,7 +67,7 @@ impl mls_rs_core::group::GroupStateStorage for GroupStateStorageWrapper {
67
67
where
68
68
T : mls_rs_core:: group:: GroupState + MlsEncode + MlsDecode ,
69
69
{
70
- let state_data = self . 0 . state ( group_id) ?;
70
+ let state_data = self . 0 . state ( group_id. to_vec ( ) ) ?;
71
71
72
72
state_data
73
73
. as_deref ( )
@@ -80,7 +80,7 @@ impl mls_rs_core::group::GroupStateStorage for GroupStateStorageWrapper {
80
80
where
81
81
T : mls_rs_core:: group:: EpochRecord + MlsEncode + MlsDecode ,
82
82
{
83
- let epoch_data = self . 0 . epoch ( group_id, epoch_id) ?;
83
+ let epoch_data = self . 0 . epoch ( group_id. to_vec ( ) , epoch_id) ?;
84
84
85
85
epoch_data
86
86
. as_deref ( )
@@ -118,6 +118,6 @@ impl mls_rs_core::group::GroupStateStorage for GroupStateStorageWrapper {
118
118
}
119
119
120
120
async fn max_epoch_id ( & self , group_id : & [ u8 ] ) -> Result < Option < u64 > , Self :: Error > {
121
- self . 0 . max_epoch_id ( group_id)
121
+ self . 0 . max_epoch_id ( group_id. to_vec ( ) )
122
122
}
123
123
}
0 commit comments