pub struct TrashClient<'a, T: Transport, A: AuthProvider> { /* private fields */ }Expand description
WebDAV client for interacting with Nextcloud’s trashbin endpoints.
Executes calls through any Transport and applies credentials via an AuthProvider.
Both are held by reference, allowing the client to be freely cloned or borrowed across
tasks without runtime dispatch or connection pooling overhead.
Supported operations:
Implementations§
Source§impl<'a, T: Transport, A: AuthProvider> TrashClient<'a, T, A>
impl<'a, T: Transport, A: AuthProvider> TrashClient<'a, T, A>
Sourcepub const fn new(transport: &'a T, auth: &'a A) -> Self
pub const fn new(transport: &'a T, auth: &'a A) -> Self
Binds a trashbin client to a transport and credential provider.
Sourcepub async fn list(&self, user_id: &str) -> Result<Vec<TrashItem>, Error>
pub async fn list(&self, user_id: &str) -> Result<Vec<TrashItem>, Error>
Lists all items currently in user_id’s trashbin.
Sends a PROPFIND request with Depth: 1 to /remote.php/dav/trashbin/{user_id}/trash/.
The response must be 207 Multi-Status; any other status becomes Error::Status.
Sourcepub async fn restore(
&self,
user_id: &str,
item_id: &str,
restore_path: &str,
) -> Result<(), Error>
pub async fn restore( &self, user_id: &str, item_id: &str, restore_path: &str, ) -> Result<(), Error>
Restores a deleted item from the trashbin.
Sends a MOVE request from /remote.php/dav/trashbin/{user_id}/trash/{item_id}
to /remote.php/dav/trashbin/{user_id}/restore/{restore_path} (or the restore
folder if restore_path is empty).
Any non-2xx status returns Error::Status.