pub struct ConfigRuntime { /* private fields */ }Expand description
File-backed config runtime with monotonic generation CAS.
Implementations§
Source§impl ConfigRuntime
impl ConfigRuntime
Sourcepub fn new(store: Arc<dyn ConfigStore>, state_path: PathBuf) -> Self
pub fn new(store: Arc<dyn ConfigStore>, state_path: PathBuf) -> Self
Create a config runtime using an explicit state file path.
Sourcepub fn from_store_metadata(store: Arc<dyn ConfigStore>) -> Option<Self>
pub fn from_store_metadata(store: Arc<dyn ConfigStore>) -> Option<Self>
Construct from store metadata when a resolved realm root is available.
Sourcepub async fn get(&self) -> Result<ConfigSnapshot, ConfigRuntimeError>
pub async fn get(&self) -> Result<ConfigSnapshot, ConfigRuntimeError>
Read current config + generation.
Sourcepub async fn set(
&self,
config: Config,
expected_generation: Option<u64>,
) -> Result<ConfigSnapshot, ConfigRuntimeError>
pub async fn set( &self, config: Config, expected_generation: Option<u64>, ) -> Result<ConfigSnapshot, ConfigRuntimeError>
Replace config with optional generation check.
Sourcepub async fn patch(
&self,
delta: ConfigDelta,
expected_generation: Option<u64>,
) -> Result<ConfigSnapshot, ConfigRuntimeError>
pub async fn patch( &self, delta: ConfigDelta, expected_generation: Option<u64>, ) -> Result<ConfigSnapshot, ConfigRuntimeError>
Apply JSON merge patch with optional generation check.
Auto Trait Implementations§
impl !Freeze for ConfigRuntime
impl !RefUnwindSafe for ConfigRuntime
impl Send for ConfigRuntime
impl Sync for ConfigRuntime
impl Unpin for ConfigRuntime
impl UnsafeUnpin for ConfigRuntime
impl !UnwindSafe for ConfigRuntime
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
Mutably borrows from an owned value. Read more