pub enum StateBackendConfig {
InProcess,
Local {
path: PathBuf,
},
ObjectStore {
url: String,
storage: StorageOptions,
},
}Expand description
Tagged-union config that selects checkpoint-artifact storage.
Variants§
InProcess
Non-durable in-process backend. The default.
Local
Durable single-node backend on a local filesystem path. Shorthand
for an object_store backend with a file:// URL.
ObjectStore
Object-store backend. Cloud URLs (s3://, gs://, az://) are
cluster-shared; file:// is node-durable only.
Fields
storage: StorageOptionsCloud credentials/config overrides (e.g. endpoint,
aws_access_key_id), same keys as [checkpoint.storage].
Anything absent falls back to the provider’s standard env
vars (AWS_ACCESS_KEY_ID, …).
Implementations§
Source§impl StateBackendConfig
impl StateBackendConfig
Sourcepub fn in_process() -> Self
pub fn in_process() -> Self
Builder: embedded library, single process.
Sourcepub fn local(path: impl Into<PathBuf>) -> Self
pub fn local(path: impl Into<PathBuf>) -> Self
Builder: single-node durable state on the local filesystem.
Sourcepub fn object_store(url: impl Into<String>) -> Self
pub fn object_store(url: impl Into<String>) -> Self
Builder: object-store-backed state for an embedded or single-node runtime.
Credentials resolve from the provider’s standard env vars; use
the storage config field for explicit overrides.
Sourcepub fn build(
&self,
key_groups: KeyGroupCount,
) -> Result<Arc<dyn StateBackend>, StateBackendBuildError>
pub fn build( &self, key_groups: KeyGroupCount, ) -> Result<Arc<dyn StateBackend>, StateBackendBuildError>
Instantiate the runtime backend.
§Errors
StateBackendBuildError::Storefor a bad URL, a scheme whose feature flag (aws/gcs/azure) is not compiled in, or cloud-client construction failure.StateBackendBuildError::Ioon filesystem setup.
Sourcepub fn local_storage_dir(&self) -> Option<&Path>
pub fn local_storage_dir(&self) -> Option<&Path>
Filesystem path for durable state, if any. Returns None for
non-filesystem backends.
Sourcepub fn build_object_store(
&self,
) -> Result<Option<Arc<dyn ObjectStore>>, StateBackendBuildError>
pub fn build_object_store( &self, ) -> Result<Option<Arc<dyn ObjectStore>>, StateBackendBuildError>
Build the underlying object_store handle (if any) so callers
that need to share the same store — e.g. an
AssignmentSnapshotStore alongside the state backend — can
avoid re-parsing the URL. None for InProcess.
§Errors
Same failure modes as Self::build.
Sourcepub fn durability_scope(&self) -> StateBackendDurability
pub fn durability_scope(&self) -> StateBackendDurability
Failure scope survived by the configured backend.
A local path and file:// survive a same-node process restart but do
not claim peer visibility. Supported cloud schemes name a shared
service and therefore satisfy cluster recovery admission.
Trait Implementations§
Source§impl Clone for StateBackendConfig
impl Clone for StateBackendConfig
Source§fn clone(&self) -> StateBackendConfig
fn clone(&self) -> StateBackendConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StateBackendConfig
impl Debug for StateBackendConfig
Source§impl Default for StateBackendConfig
impl Default for StateBackendConfig
Source§fn default() -> StateBackendConfig
fn default() -> StateBackendConfig
Source§impl<'de> Deserialize<'de> for StateBackendConfig
impl<'de> Deserialize<'de> for StateBackendConfig
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for StateBackendConfig
Source§impl PartialEq for StateBackendConfig
impl PartialEq for StateBackendConfig
impl StructuralPartialEq for StateBackendConfig
Auto Trait Implementations§
impl Freeze for StateBackendConfig
impl RefUnwindSafe for StateBackendConfig
impl Send for StateBackendConfig
impl Sync for StateBackendConfig
impl Unpin for StateBackendConfig
impl UnsafeUnpin for StateBackendConfig
impl UnwindSafe for StateBackendConfig
Blanket Implementations§
impl<T> Allocation for T
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].