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) -> Option<Compression>
pub fn compression(&self) -> Option<Compression>
Returns the compression algorithm to use for operations within this usecase.
Sourcepub fn with_compression(
self,
compression: impl Into<Option<Compression>>,
) -> Self
pub fn with_compression( self, compression: impl Into<Option<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. Pass None to disable compression.
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Usecase
impl RefUnwindSafe for Usecase
impl Send for Usecase
impl Sync for Usecase
impl Unpin for Usecase
impl UnsafeUnpin for Usecase
impl UnwindSafe for Usecase
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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