pub enum S3Object {
NotVersioning(Object),
Versioning(ObjectVersion),
DeleteMarker(DeleteMarkerEntry),
}Expand description
S3 object representation used throughout the deletion pipeline.
Adapted from s3sync’s S3syncObject enum, representing the different kinds of objects that can be listed from S3.
§Variants
NotVersioning— An object from a non-versioned bucket (or current version from a versioned bucket listed without version info).Versioning— A specific version of an object in a versioned bucket.DeleteMarker— A delete marker in a versioned bucket (size is always 0).
§Constructors
Use S3Object::new and S3Object::new_versioned to create instances
without importing AWS SDK types directly:
use s3rm_rs::S3Object;
let obj = S3Object::new("my-key", 1024);
assert_eq!(obj.key(), "my-key");
assert_eq!(obj.size(), 1024);Variants§
NotVersioning(Object)
An object from a non-versioned bucket.
Versioning(ObjectVersion)
A specific version of an object in a versioned bucket.
DeleteMarker(DeleteMarkerEntry)
A delete marker in a versioned bucket (size is always 0).
Implementations§
Source§impl S3Object
impl S3Object
Sourcepub fn new(key: &str, size: i64) -> Self
pub fn new(key: &str, size: i64) -> Self
Create a non-versioned S3 object with the given key and size in bytes.
The last_modified timestamp defaults to the Unix epoch. This constructor
is useful for testing filter callbacks without importing AWS SDK types.
§Examples
use s3rm_rs::S3Object;
let obj = S3Object::new("photos/cat.jpg", 2048);
assert_eq!(obj.key(), "photos/cat.jpg");
assert_eq!(obj.size(), 2048);
assert!(obj.version_id().is_none());Sourcepub fn new_versioned(key: &str, version_id: &str, size: i64) -> Self
pub fn new_versioned(key: &str, version_id: &str, size: i64) -> Self
Create a versioned S3 object with the given key, version ID, and size in bytes.
The last_modified timestamp defaults to the Unix epoch, and is_latest
is set to true. This constructor is useful for testing filter callbacks
on versioned objects without importing AWS SDK types.
§Examples
use s3rm_rs::S3Object;
let obj = S3Object::new_versioned("logs/app.log", "v1", 512);
assert_eq!(obj.key(), "logs/app.log");
assert_eq!(obj.version_id(), Some("v1"));
assert_eq!(obj.size(), 512);pub fn key(&self) -> &str
pub fn last_modified(&self) -> &DateTime
pub fn size(&self) -> i64
pub fn version_id(&self) -> Option<&str>
pub fn e_tag(&self) -> Option<&str>
pub fn is_latest(&self) -> bool
pub fn is_delete_marker(&self) -> bool
Trait Implementations§
impl StructuralPartialEq for S3Object
Auto Trait Implementations§
impl Freeze for S3Object
impl RefUnwindSafe for S3Object
impl Send for S3Object
impl Sync for S3Object
impl Unpin for S3Object
impl UnsafeUnpin for S3Object
impl UnwindSafe for S3Object
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