pub struct Durability {
pub tier: DurabilityTier,
pub engine: Option<DurabilityEngine>,
pub store: Option<String>,
pub subjects: Vec<String>,
pub rpo_seconds: Option<u32>,
pub state_mb: Option<u32>,
}Expand description
A workload’s durability declaration — WorkloadSpec::durability.
Every field but tier defaults, because which of them are required depends
on the tier, and that is a rule serde cannot express. Self::check is
where it is enforced; read the declaration through
WorkloadSpec::durability, which applies it.
Fields§
§tier: DurabilityTier§engine: Option<DurabilityEngine>Which engine’s tier vocabulary this is. Some exactly when
DurabilityTier::ships_bytes — enforced by Self::check (R850-F1).
store: Option<String>Object-store URL the copy lives at. Some (and non-blank) exactly when
DurabilityTier::ships_bytes — enforced by Self::check.
subjects: Vec<String>Volume-relative paths of the database files this tier covers, in
declaration order. Non-empty exactly when
DurabilityTier::ships_bytes — enforced by Self::check (R850-F1).
Volume-relative, never absolute: the same string is joined onto the
container’s mount target when read as documentation and onto
/var/lib/yah/kamaji/volumes/<name> when a hydrate writes it. Each is
also the object-store key suffix under Self::store, so the layout an
operator sees in the bucket mirrors the layout on the volume.
rpo_seconds: Option<u32>Declared recovery-point objective in seconds. DurabilityTier::Stream
only; None there means turso_backup::stream::DEFAULT_RPO_TARGET.
state_mb: Option<u32>Expected steady-state size of this workload’s state, in MiB — the input
a cold-start-from-object-store estimate needs and cannot get anywhere
else. The microVM scratch floor (WorkloadSpec::scratch_floor_mb) is
not it: that sizes a job’s ephemeral workspace, and a named volume is
neither ephemeral nor a workspace.
Declared, never measured. Any recovery-time figure derived from it inherits that, and must say so at the point it is printed.
Implementations§
Source§impl Durability
impl Durability
Sourcepub fn check(&self) -> Result<(), DurabilityDeclError>
pub fn check(&self) -> Result<(), DurabilityDeclError>
The rules that span fields, which serde cannot enforce. Checked in the order a human would fix them: where the copy goes, when, what engine, which files.
Trait Implementations§
Source§impl Clone for Durability
impl Clone for Durability
Source§fn clone(&self) -> Durability
fn clone(&self) -> Durability
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 Durability
impl Debug for Durability
Source§impl<'de> Deserialize<'de> for Durability
impl<'de> Deserialize<'de> for Durability
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 Durability
Source§impl PartialEq for Durability
impl PartialEq for Durability
Source§impl Serialize for Durability
impl Serialize for Durability
impl StructuralPartialEq for Durability
Source§impl TS for Durability
impl TS for Durability
Source§type WithoutGenerics = Durability
type WithoutGenerics = Durability
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = Durability
type OptionInnerType = Durability
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read moreSource§fn export_to_string(cfg: &Config) -> Result<String, ExportError>where
Self: 'static,
fn export_to_string(cfg: &Config) -> Result<String, ExportError>where
Self: 'static,
Auto Trait Implementations§
impl Freeze for Durability
impl RefUnwindSafe for Durability
impl Send for Durability
impl Sync for Durability
impl Unpin for Durability
impl UnsafeUnpin for Durability
impl UnwindSafe for Durability
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.