pub struct Config {Show 30 fields
pub target: StoragePath,
pub show_no_progress: bool,
pub target_client_config: Option<ClientConfig>,
pub force_retry_config: ForceRetryConfig,
pub tracing_config: Option<TracingConfig>,
pub worker_size: u16,
pub warn_as_error: bool,
pub dry_run: bool,
pub rate_limit_objects: Option<u32>,
pub max_parallel_listings: u16,
pub object_listing_queue_size: u32,
pub max_parallel_listing_max_depth: u16,
pub allow_parallel_listings_in_express_one_zone: bool,
pub filter_config: FilterConfig,
pub max_keys: i32,
pub auto_complete_shell: Option<Shell>,
pub event_callback_lua_script: Option<String>,
pub filter_callback_lua_script: Option<String>,
pub allow_lua_os_library: bool,
pub allow_lua_unsafe_vm: bool,
pub lua_vm_memory_limit: usize,
pub lua_callback_timeout_milliseconds: u64,
pub if_match: bool,
pub max_delete: Option<u64>,
pub filter_manager: FilterManager,
pub event_manager: EventManager,
pub batch_size: u16,
pub delete_all_versions: bool,
pub force: bool,
pub test_user_defined_callback: bool,
}Expand description
Main configuration for the s3rm-rs deletion pipeline.
Holds all settings needed to configure and run a DeletionPipeline:
target bucket/prefix, AWS credentials, worker pool size, filter rules,
safety flags (dry-run, force, max-delete), and callback registrations.
Adapted from s3sync’s Config, removing source-specific and sync-specific options. Only target-related configuration is retained since s3rm-rs operates on a single S3 target.
§Quick Start
The recommended way to build a Config is build_config_from_args,
which performs all CLI-level validation (conflicting flags, rate-limit vs batch-size, etc.):
let config = s3rm_rs::build_config_from_args([
"s3rm", "s3://my-bucket/logs/2024/", "--dry-run", "--force",
]).expect("invalid arguments");Alternatively, Config::for_target creates a minimal configuration with sensible
defaults, but command-line validation checks are not performed:
use s3rm_rs::Config;
let config = Config::for_target("my-bucket", "logs/2024/");
assert_eq!(config.worker_size, 16);
assert_eq!(config.batch_size, 200);Then customize fields as needed:
use s3rm_rs::Config;
let mut config = Config::for_target("my-bucket", "logs/2024/");
config.dry_run = true;
config.force = true;
config.worker_size = 100;
config.max_delete = Some(10_000);§Default
Config::default() creates a configuration targeting an empty bucket/prefix.
You must set the target field before running a pipeline.
use s3rm_rs::Config;
use s3rm_rs::types::StoragePath;
let mut config = Config::default();
config.target = StoragePath::S3 {
bucket: "my-bucket".into(),
prefix: "prefix/".into(),
};Fields§
§target: StoragePath§show_no_progress: bool§target_client_config: Option<ClientConfig>§force_retry_config: ForceRetryConfig§tracing_config: Option<TracingConfig>§worker_size: u16§warn_as_error: bool§dry_run: bool§rate_limit_objects: Option<u32>§max_parallel_listings: u16§object_listing_queue_size: u32§max_parallel_listing_max_depth: u16§allow_parallel_listings_in_express_one_zone: bool§filter_config: FilterConfig§max_keys: i32§auto_complete_shell: Option<Shell>§event_callback_lua_script: Option<String>§filter_callback_lua_script: Option<String>§allow_lua_os_library: bool§allow_lua_unsafe_vm: bool§lua_vm_memory_limit: usize§lua_callback_timeout_milliseconds: u64§if_match: bool§max_delete: Option<u64>§filter_manager: FilterManager§event_manager: EventManager§batch_size: u16§delete_all_versions: bool§force: bool§test_user_defined_callback: boolImplementations§
Source§impl Config
impl Config
Sourcepub fn for_target(bucket: &str, prefix: &str) -> Self
pub fn for_target(bucket: &str, prefix: &str) -> Self
Create a Config with sensible defaults for the given S3 bucket and prefix.
All fields are set to production-ready defaults matching the CLI defaults
(16 workers, batch size 200, etc.). The force flag is set to true to
skip interactive confirmation prompts, which is appropriate for programmatic use.
Note: This bypasses CLI-level validation (conflicting flags, rate-limit
vs batch-size, etc.). Prefer build_config_from_args
when possible.
§Examples
use s3rm_rs::Config;
let config = Config::for_target("my-bucket", "logs/");
assert_eq!(config.batch_size, 200);
assert!(config.force); // no interactive promptsTrait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl !UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more