DriveFilesClient#

pub struct DriveFilesClient#

Client for file operations scoped to a single drive in the Nominal file store.

Implementations#

impl DriveFilesClient
pub fn drive_rid(&self) -> &str#

The RID of the drive this client operates on.

pub async fn put(&self, local_path: impl AsRef<Path>, destination_path: &str, options: UploadOptions) -> Result<LogicalFile>#

Upload a local file and place it at destination_path in the drive, creating the file. Fails if a file already exists at that path.

pub async fn list(&self, parent_path: &str, include_removed: bool) -> Result<Vec<FileEntry>>#

List files and directories directly under parent_path. The empty path lists the drive root. Collects all pages eagerly.

pub async fn get(&self, path: &str) -> Result<LogicalFile>#

Get a file by its drive-relative path.

pub async fn download(&self, path: &str) -> Result<impl AsyncRead + Unpin + use<>>#

Open the current content of the file at path for streaming download.

The file’s current managed revision is resolved first, then its short-lived presigned URL is opened. The returned reader owns the HTTP response and should be consumed promptly because the URL is short-lived.

pub async fn list_revisions(&self, file_rid: &str) -> Result<Vec<FileRevision>>#

List revisions for a managed file, oldest first. Collects all pages eagerly.

pub async fn move_file(&self, source_revision_rid: &str, destination: impl Into<FileOperationDestination>) -> Result<LogicalFile>#

Move a file, identified by its current head revision, to a destination. Fails if source_revision_rid is not the file’s current head.

pub async fn remove(&self, revision_rid: &str) -> Result<LogicalFile>#

Soft-delete a file, identified by its current head revision. Fails if revision_rid is not the file’s current head.

pub async fn restore(&self, restore_revision_rid: &str, destination: impl Into<FileOperationDestination>) -> Result<LogicalFile>#

Reinstate a past revision at a destination path or by replacing an existing revision.

Trait implementations#

Auto traits: Send, Sync, Unpin, !UnwindSafe, !RefUnwindSafe