Skip to main content

S3State

Struct S3State 

Source
pub struct S3State {
    pub account_id: String,
    pub region: String,
    pub buckets: BTreeMap<String, S3Bucket>,
    pub notification_events: Vec<S3NotificationEvent>,
    pub body_cache: Option<Arc<BodyCache>>,
    pub object_lambda_responses: BTreeMap<String, ObjectLambdaResponse>,
    pub access_points: BTreeMap<String, S3AccessPoint>,
}

Fields§

§account_id: String§region: String§buckets: BTreeMap<String, S3Bucket>§notification_events: Vec<S3NotificationEvent>§body_cache: Option<Arc<BodyCache>>§object_lambda_responses: BTreeMap<String, ObjectLambdaResponse>

Object Lambda responses keyed by request token.

§access_points: BTreeMap<String, S3AccessPoint>

Implementations§

Source§

impl S3State

Source

pub fn new(account_id: &str, region: &str) -> Self

Source

pub fn set_body_cache(&mut self, cache: Arc<BodyCache>)

Source

pub fn reset(&mut self)

Source

pub fn read_body_uncached(body: &BodyRef) -> Result<Bytes>

Read the full body referenced by a BodyRef without touching the BodyCache or any S3State. Because it borrows nothing from state, callers can read part bodies after dropping the global S3 lock — used by CompleteMultipartUpload to assemble a multi-GB object off-lock instead of serializing every other S3 operation behind the assembly (bug-audit 2026-05-28, 4.7). Disk bodies are read straight from their path.

Source

pub fn read_body(&self, body: &BodyRef) -> Result<Bytes>

Read the full body referenced by a BodyRef, consulting the persistent BodyCache when one is configured.

Source

pub fn read_body_range( &self, body: &BodyRef, offset: u64, len: u64, ) -> Result<Bytes>

Read a byte range from the body without loading the full object into memory. Memory bodies are sliced directly; disk bodies are seek+read’d. Ranges bypass the body cache (the cache stores whole objects only).

Trait Implementations§

Source§

impl AccountState for S3State

Source§

fn new_for_account(account_id: &str, region: &str, _endpoint: &str) -> Self

Create a fresh, empty state for the given account.
Source§

fn inherit_from(&mut self, sibling: &Self)

Called after a new account state is created via MultiAccountState::get_or_create, with a reference to an existing sibling state. Services can override this to propagate shared resources (e.g. body caches) to the new state.

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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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