Skip to main content

ObjectStore

Enum ObjectStore 

Source
pub enum ObjectStore {
    Unversioned(KeyStore),
    Versioned(VersionedKeyStore),
}
Expand description

Top-level object store that dispatches to either an un-versioned or versioned backing store.

Variants§

§

Unversioned(KeyStore)

Un-versioned storage. Each key maps to exactly one object.

§

Versioned(VersionedKeyStore)

Versioned storage. Each key maps to an ordered list of versions.

Implementations§

Source§

impl ObjectStore

Source

pub fn put(&mut self, object: S3Object) -> Option<S3Object>

Store an object. Returns the previous object for un-versioned stores.

Source

pub fn get(&self, key: &str) -> Option<&S3Object>

Get the current (latest non-delete-marker) object for a key.

Source

pub fn get_version(&self, key: &str, version_id: &str) -> Option<&S3Object>

Get a specific version of an object by key and version ID.

Source

pub fn get_mut(&mut self, key: &str) -> Option<&mut S3Object>

Get a mutable reference to the current (latest non-delete-marker) object. Used for in-place metadata updates (e.g., retention, legal hold).

Source

pub fn get_version_mut( &mut self, key: &str, version_id: &str, ) -> Option<&mut S3Object>

Get a mutable reference to a specific version by key and version ID. Used for in-place metadata updates (e.g., retention, legal hold).

Source

pub fn is_delete_marker(&self, key: &str, version_id: &str) -> bool

Check if a specific version ID for a key is a delete marker.

Source

pub fn delete(&mut self, key: &str) -> Option<S3Object>

Delete the object for a key (un-versioned semantics: removes the object).

Source

pub fn delete_versioned( &mut self, key: &str, owner: &Owner, ) -> (Option<String>, bool)

Delete an object in a versioned bucket by inserting a delete marker.

Returns (Some(version_id), true) if a delete marker was created and an existing object was logically hidden, or (Some(version_id), false) if a delete marker was created but no real object existed for that key.

For un-versioned stores, removes the object directly and returns (None, had_object).

Source

pub fn delete_version( &mut self, key: &str, version_id: &str, ) -> Option<ObjectVersion>

Delete a specific version of an object.

Source

pub fn list_objects( &self, prefix: &str, delimiter: &str, start_after: &str, max_keys: usize, ) -> ListResult

List objects matching a prefix, delimiter, start-after, and max-keys.

Source

pub fn list_object_versions( &self, prefix: &str, delimiter: &str, key_marker: &str, version_id_marker: &str, max_keys: usize, ) -> VersionListResult

List object versions.

Source

pub fn len(&self) -> usize

Count of non-deleted objects.

Source

pub fn is_empty(&self) -> bool

Whether the store contains zero entries (objects, versions, or delete markers).

This checks for truly empty storage (no entries at all), which is the correct check for DeleteBucket. For listing purposes, use Self::len() which only counts non-deleted objects.

Source

pub fn transition_to_versioned(&mut self)

Transition from un-versioned to versioned storage.

If already versioned this is a no-op. Existing objects are migrated into single-element version lists.

Source

pub fn is_versioned(&self) -> bool

Whether the store is in versioned mode.

Trait Implementations§

Source§

impl Debug for ObjectStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ObjectStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more