Struct LiveConfig
pub struct LiveConfig { /* private fields */ }Expand description
Canonical live-config storage for one authority generation.
Cloning shares the storage (and therefore the epoch and sequence);
constructing a new LiveConfig starts a fresh epoch whose initial
publication is sequence zero. The paired state is private: readers go
through LiveConfigHandle, and publication goes through
LiveConfig::next_revision plus LiveConfig::publish under the
owning transaction’s serialization.
Implementations§
Source§impl LiveConfig
impl LiveConfig
Sourcepub fn new(config: Config) -> Self
pub fn new(config: Config) -> Self
Create the storage with config as the initial publication of a
fresh epoch.
Sourcepub fn handle(&self) -> LiveConfigHandle
pub fn handle(&self) -> LiveConfigHandle
The read-only facade over this storage.
Sourcepub fn epoch(&self) -> ConfigEpoch
pub fn epoch(&self) -> ConfigEpoch
The epoch all publications of this storage belong to.
Sourcepub fn published_revision(&self) -> ConfigRevision
pub fn published_revision(&self) -> ConfigRevision
The currently published revision.
Sourcepub fn next_revision(&self) -> Result<ConfigRevision, LiveConfigError>
pub fn next_revision(&self) -> Result<ConfigRevision, LiveConfigError>
Allocate the next publication identity, checking representability. Call before any irreversible persistence: an exhausted epoch must fail before disk state can change, not after.
Sourcepub fn publish(
&self,
revision: ConfigRevision,
config: Config,
) -> Result<ConfigRevision, LiveConfigError>
pub fn publish( &self, revision: ConfigRevision, config: Config, ) -> Result<ConfigRevision, LiveConfigError>
Install config as the published pair under exactly revision.
revision must be the successor of the currently published
revision within the same epoch; anything else (stale, repeated, or
cross-epoch) is refused with the published pair unchanged. The
write lock is held only for the pair install — never across
persistence I/O, which the caller performs between allocation and
this call.
Trait Implementations§
Source§impl Clone for LiveConfig
impl Clone for LiveConfig
Source§fn clone(&self) -> LiveConfig
fn clone(&self) -> LiveConfig
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for LiveConfig
impl !UnwindSafe for LiveConfig
impl Freeze for LiveConfig
impl Send for LiveConfig
impl Sync for LiveConfig
impl Unpin for LiveConfig
impl UnsafeUnpin for LiveConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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