| 1 | use bitcode::{Decode, Encode}; |
| 2 | |
| 3 | use crate::{call::Request, model::Id}; |
| 4 | |
| 5 | #[derive(Debug, Clone, Encode, Decode)] |
| 6 | pub enum Open { |
| 7 | Call(Box<Request>), |
| 8 | Upload(Upload), |
| 9 | Fetch(Blob), |
| 10 | Stage(Stage), |
| 11 | } |
| 12 | |
| 13 | #[derive(Debug, Clone, Encode, Decode)] |
| 14 | pub struct Stage { |
| 15 | pub size: u64, |
| 16 | } |
| 17 | |
| 18 | #[derive(Debug, Clone, Encode, Decode)] |
| 19 | pub struct Upload { |
| 20 | pub community_id: Id, |
| 21 | pub name: String, |
| 22 | pub size: u64, |
| 23 | } |
| 24 | |
| 25 | #[derive(Debug, Clone, PartialEq, Eq, Hash, Encode, Decode)] |
| 26 | pub enum Blob { |
| 27 | Attachment(Id), |
| 28 | Thumbnail(Id), |
| 29 | Backup(String), |
| 30 | } |