pub struct Usecase { /* private fields */ }Expand description
An identifier for a workload in Objectstore, along with defaults to use for all operations within that Usecase.
Usecases need to be statically defined in Objectstore’s configuration server-side. Objectstore can make decisions based on the Usecase. For example, choosing the most suitable storage backend.
Implementations§
Source§impl Usecase
impl Usecase
Sourcepub fn compression(&self) -> Compression
pub fn compression(&self) -> Compression
Returns the compression algorithm to use for operations within this usecase.
Sourcepub fn with_compression(self, compression: Compression) -> Self
pub fn with_compression(self, compression: Compression) -> Self
Sets the compression algorithm to use for operations within this usecase.
It’s still possible to override this default on each operation’s builder.
By default, Compression::Zstd is used.
Sourcepub fn expiration_policy(&self) -> ExpirationPolicy
pub fn expiration_policy(&self) -> ExpirationPolicy
Returns the expiration policy to use by default for operations within this usecase.
Sourcepub fn with_expiration_policy(self, expiration_policy: ExpirationPolicy) -> Self
pub fn with_expiration_policy(self, expiration_policy: ExpirationPolicy) -> Self
Sets the expiration policy to use for operations within this usecase.
It’s still possible to override this default on each operation’s builder.
By default, ExpirationPolicy::Manual is used, meaning that objects won’t automatically
expire.
Sourcepub fn scope(&self) -> Scope
pub fn scope(&self) -> Scope
Creates a new custom Scope.
Add parts to it using Scope::push.
Generally, Usecase::for_organization and Usecase::for_project should fit most usecases,
so prefer using those methods rather than creating your own custom Scope.
Sourcepub fn for_organization(&self, organization: u64) -> Scope
pub fn for_organization(&self, organization: u64) -> Scope
Creates a new Scope tied to the given organization.