Struct ConfigCommit
pub struct ConfigCommit { /* private fields */ }Expand description
One admitted, serialized config write.
Owns the process-wide writer guard and the generation write lease
from admission until the commit completes (or the value drops before
dispatch, which abandons preparation and releases both). Created only
through LiveConfigAuthority::begin_config_commit.
The intended writer shape is: current_config() → stage a mutated
clone → next_revision() (checked, before any irreversible I/O) →
run persistence → publish() the committed candidate under the
allocated revision. To make the irreversible phase uncancellable,
move this value into a detached task (see
spawn_agent_lifecycle_job) before the first persistence await;
the task then owns serialization and drain accounting until it
finishes, and a dropped requester cannot strand a committed disk
write without its publication.
Implementations§
Source§impl ConfigCommit
impl ConfigCommit
Sourcepub fn current_config(&self) -> Config
pub fn current_config(&self) -> Config
Clone the currently published config. Read-for-modify under this commit’s serialization: no other admitted writer can interleave.
Sourcepub fn published_revision(&self) -> ConfigRevision
pub fn published_revision(&self) -> ConfigRevision
The revision currently published.
Sourcepub fn next_revision(&self) -> Result<ConfigRevision, ConfigCommitError>
pub fn next_revision(&self) -> Result<ConfigRevision, ConfigCommitError>
Allocate the next publication identity, checking representability. Call before any irreversible persistence: an exhausted epoch must refuse the commit while disk state is still unchanged.
Sourcepub fn publish(
&self,
revision: ConfigRevision,
config: Config,
) -> Result<(), ConfigCommitError>
pub fn publish( &self, revision: ConfigRevision, config: Config, ) -> Result<(), ConfigCommitError>
Publish one committed candidate under its pre-allocated revision. Installs the config and revision as one pair; refuses a revision that is not the exact successor of the published one.
Sourcepub fn live_handle(&self) -> LiveConfigHandle
pub fn live_handle(&self) -> LiveConfigHandle
Read-only live handle over the storage this commit publishes to, for post-commit reads.
Sourcepub fn release_serialization(self)
pub fn release_serialization(self)
Release serialization explicitly — the writer guard and the generation write lease drop here — while the caller continues with slow, non-config side effects. The retained destructive transactions call this after their required config work, exactly where they previously dropped the raw writer guard before workspace cleanup.
Auto Trait Implementations§
impl !RefUnwindSafe for ConfigCommit
impl !UnwindSafe for ConfigCommit
impl Freeze for ConfigCommit
impl Send for ConfigCommit
impl Sync for ConfigCommit
impl Unpin for ConfigCommit
impl UnsafeUnpin for ConfigCommit
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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