(mut collab: Collab, notifier: Option<FolderNotify>)
| 94 | |
| 95 | impl Folder { |
| 96 | pub fn open(mut collab: Collab, notifier: Option<FolderNotify>) -> Result<Self, CollabError> { |
| 97 | let body = FolderBody::open(&mut collab, notifier)?; |
| 98 | let folder = Folder { collab, body }; |
| 99 | if folder.get_workspace_id().is_none() { |
| 100 | // When the folder is opened, the workspace id must be present. |
| 101 | Err(CollabError::FolderMissingRequiredData( |
| 102 | "missing workspace id".into(), |
| 103 | )) |
| 104 | } else { |
| 105 | Ok(folder) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | pub fn create(mut collab: Collab, notifier: Option<FolderNotify>, data: FolderData) -> Self { |
| 110 | let body = FolderBody::open_with(&mut collab, notifier, Some(data)); |
no test coverage detected