Skip to content

Commit

Permalink
Add doc for list_objects
Browse files Browse the repository at this point in the history
  • Loading branch information
donatello committed Sep 29, 2023
1 parent 8ecabea commit 6f51637
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minio"
version = "0.1.0"
version = "0.2.0-alpha"
edition = "2021"
authors = ["MinIO Dev Team <[email protected]>"]
description = "MinIO SDK for Amazon S3 compatible object storage access"
Expand Down
26 changes: 19 additions & 7 deletions src/s3/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1116,21 +1116,33 @@ pub struct ListObjectsArgs<'a> {
pub extra_headers: Option<&'a Multimap>,
pub extra_query_params: Option<&'a Multimap>,
pub region: Option<&'a str>,
/// Specifies the bucket name on which listing is to be performed.
pub bucket: &'a str,
/// Delimiter to roll up common prefixes on.
pub delimiter: Option<&'a str>,
pub use_url_encoding_type: bool,
pub marker: Option<&'a str>, // only for ListObjectsV1.
pub start_after: Option<&'a str>, // only for ListObjectsV2.
pub key_marker: Option<&'a str>, // only for GetObjectVersions.
/// Used only with ListObjectsV1.
pub marker: Option<&'a str>,
/// Used only with ListObjectsV2
pub start_after: Option<&'a str>,
/// Used only with GetObjectVersions.
pub key_marker: Option<&'a str>,
pub max_keys: Option<u16>,
pub prefix: Option<&'a str>,
pub continuation_token: Option<&'a str>, // only for ListObjectsV2.
pub fetch_owner: bool, // only for ListObjectsV2.
pub version_id_marker: Option<&'a str>, // only for GetObjectVersions.
pub include_user_metadata: bool, // MinIO extension for ListObjectsV2.
/// Used only with ListObjectsV2.
pub continuation_token: Option<&'a str>,
/// Used only with ListObjectsV2.
pub fetch_owner: bool,
/// Used only with GetObjectVersions.
pub version_id_marker: Option<&'a str>,
/// MinIO extension for ListObjectsV2.
pub include_user_metadata: bool,
pub recursive: bool,
/// Set this to use ListObjectsV1. Defaults to false.
pub use_api_v1: bool,
/// Set this to include versions.
pub include_versions: bool,
/// A callback function to process results of object listing.
pub result_fn: &'a dyn Fn(Vec<Item>) -> bool,
}

Expand Down
3 changes: 3 additions & 0 deletions src/s3/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2750,6 +2750,9 @@ impl Client {
})
}

/// List objects with version information optionally. `results_fn` callback
/// function is repeatedly called with object information and returning
/// false from the callback stops further listing.
pub async fn list_objects(&self, args: &ListObjectsArgs<'_>) -> Result<(), Error> {
let mut lov1_args = ListObjectsV1Args::new(args.bucket)?;
lov1_args.extra_headers = args.extra_headers;
Expand Down

0 comments on commit 6f51637

Please sign in to comment.