Skip to main content

AccountState

Trait AccountState 

Source
pub trait AccountState: Sized {
    // Required method
    fn new_for_account(account_id: &str, region: &str, endpoint: &str) -> Self;

    // Provided method
    fn inherit_from(&mut self, _sibling: &Self) { ... }
}
Expand description

Trait implemented by per-service state structs that participate in multi-account isolation.

Required Methods§

Source

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

Create a fresh, empty state for the given account.

Provided Methods§

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§