pub struct S3Target {
pub bucket: String,
pub prefix: Option<String>,
pub endpoint: Option<String>,
pub region: Option<String>,
}Expand description
S3 target specification parsed from an s3:// URI.
Represents the target bucket and optional prefix for deletion operations, along with optional endpoint and region overrides.
Fields§
§bucket: String§prefix: Option<String>§endpoint: Option<String>§region: Option<String>Implementations§
Source§impl S3Target
impl S3Target
Sourcepub fn parse(s3_uri: &str) -> Result<Self>
pub fn parse(s3_uri: &str) -> Result<Self>
Parse an S3 URI in the format s3://bucket[/prefix].
The endpoint and region fields are not set by this method; they should be configured separately from CLI arguments or environment variables.
§Examples
use s3rm_rs::types::S3Target;
let target = S3Target::parse("s3://my-bucket/logs/2023/").unwrap();
assert_eq!(target.bucket, "my-bucket");
assert_eq!(target.prefix.as_deref(), Some("logs/2023/"));
let target = S3Target::parse("s3://my-bucket").unwrap();
assert_eq!(target.bucket, "my-bucket");
assert!(target.prefix.is_none());Trait Implementations§
impl StructuralPartialEq for S3Target
Auto Trait Implementations§
impl Freeze for S3Target
impl RefUnwindSafe for S3Target
impl Send for S3Target
impl Sync for S3Target
impl Unpin for S3Target
impl UnsafeUnpin for S3Target
impl UnwindSafe for S3Target
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.