coven/handle_folders.rs
1//! Provider folder selection using the handle's pending sign-in.
2
3use super::*;
4
5impl CovenHandle {
6 /// The signed-in person's default OneDrive root and setup location.
7 /// Call authenticate first; tokens stay in coven and settings are unchanged.
8 pub async fn onedrive_root(&self) -> Result<StorageFolder, StorageSetupError> {
9 self.storage.onedrive_root().await
10 }
11
12 /// Every immediate child folder of this OneDrive location, across every page.
13 pub async fn onedrive_folders(
14 &self,
15 parent: &StorageConfig,
16 ) -> Result<Vec<StorageFolder>, StorageSetupError> {
17 self.storage.onedrive_folders(parent).await
18 }
19
20 /// Create this exact name in the chosen OneDrive parent; occupied names fail.
21 /// Returns a setup location without committing it. Close waits for creation,
22 /// including when the awaiting app drops its future.
23 pub async fn create_onedrive_folder(
24 &self,
25 parent: &StorageConfig,
26 name: &str,
27 ) -> Result<StorageFolder, StorageSetupError> {
28 self.storage.create_onedrive_folder(parent, name).await
29 }
30
31 /// Every shared Dropbox namespace the signed-in account can access.
32 /// Requires Full Dropbox sign-in; each returned location goes directly to setup.
33 pub async fn dropbox_shared_folders(&self) -> Result<Vec<StorageFolder>, StorageSetupError> {
34 self.storage.dropbox_shared_folders().await
35 }
36
37 /// Make a folder named `name` at the top of the signed-in person's
38 /// Dropbox and share it, for "New folder…" in the picker; a name already
39 /// taken fails with `AlreadyExists` and nothing is made or shared.
40 /// Requires Full Dropbox sign-in. Returns a setup location without
41 /// committing it. Close waits for the folder, including when the
42 /// awaiting app drops its future.
43 pub async fn create_dropbox_shared_folder(
44 &self,
45 name: &str,
46 ) -> Result<StorageFolder, StorageSetupError> {
47 self.storage.create_dropbox_shared_folder(name).await
48 }
49}