Skip to content

Commit

Permalink
add docstring to uploadsource
Browse files Browse the repository at this point in the history
  • Loading branch information
arilotter committed Oct 29, 2024
1 parent 2dfe54b commit 338864d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/api/tokio/upload/commit_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,23 @@ pub struct CommitOperationAdd {
pub(crate) source: UploadSource,
}

/// Represents different sources for upload data.
///
/// # Examples
///
/// ```
/// use std::path::PathBuf;
///
/// let file_source = UploadSource::File(PathBuf::from("path/to/file.txt"));
/// let bytes_source = UploadSource::Bytes(vec![1, 2, 3, 4]);
/// let empty_source = UploadSource::Emptied;
/// ```
pub enum UploadSource {
/// Contains a file path from which to read the upload data
File(PathBuf),
/// Contains the upload data directly as a byte vector
Bytes(Vec<u8>),
/// Represents a state where the upload source has been consumed or cleared
Emptied,
}

Expand Down

0 comments on commit 338864d

Please sign in to comment.