Skip to content

Commit 02fdf8c

Browse files
mgoldenbergpoljar
authored andcommitted
feat(ffi): add UploadSource for representing upload data
Signed-off-by: Michael Goldenberg <[email protected]>
1 parent 1e835b2 commit 02fdf8c

File tree

1 file changed

+17
-0
lines changed
  • bindings/matrix-sdk-ffi/src/timeline

1 file changed

+17
-0
lines changed

bindings/matrix-sdk-ffi/src/timeline/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,23 @@ pub struct UploadParameters {
223223
use_send_queue: bool,
224224
}
225225

226+
/// A source for uploading a file
227+
#[derive(uniffi::Enum)]
228+
pub enum UploadSource {
229+
/// Upload source is a file on disk
230+
File {
231+
/// Path to file
232+
filename: String,
233+
},
234+
/// Upload source is data in memory
235+
Data {
236+
/// Data being uploaded
237+
data: Vec<u8>,
238+
/// Filename to associate with data
239+
filename: String,
240+
},
241+
}
242+
226243
#[derive(uniffi::Record)]
227244
pub struct ReplyParameters {
228245
/// The ID of the event to reply to.

0 commit comments

Comments
 (0)