pub struct ConfigRegistry { /* private fields */ }Expand description
In-process registry. Accessed only through governance methods; never exposed as a SQL collection or wire surface.
Implementations§
Source§impl ConfigRegistry
impl ConfigRegistry
pub fn new() -> Self
Sourcepub fn register(
&self,
auth: &AuthStore,
actor: &UserId,
ctx: &EvalContext,
draft: ConfigRegistryDraft,
now_ms: u128,
) -> Result<ConfigRegistryEntry, RegistryError>
pub fn register( &self, auth: &AuthStore, actor: &UserId, ctx: &EvalContext, draft: ConfigRegistryDraft, now_ms: u128, ) -> Result<ConfigRegistryEntry, RegistryError>
Register a new entry. Returns AlreadyRegistered if an active
version already exists; use Self::supersede in that case.
Authorization: auth.check_policy_authz(actor, "red.registry:register", registry:<id>, ctx) must return true.
pub fn register_with_control_events( &self, auth: &AuthStore, actor: &UserId, ctx: &EvalContext, draft: ConfigRegistryDraft, now_ms: u128, control: &ConfigRegistryControl<'_>, ) -> Result<ConfigRegistryEntry, RegistryError>
Sourcepub fn supersede(
&self,
auth: &AuthStore,
actor: &UserId,
ctx: &EvalContext,
draft: ConfigRegistryDraft,
change_reason: impl Into<String>,
now_ms: u128,
) -> Result<ConfigRegistryEntry, RegistryError>
pub fn supersede( &self, auth: &AuthStore, actor: &UserId, ctx: &EvalContext, draft: ConfigRegistryDraft, change_reason: impl Into<String>, now_ms: u128, ) -> Result<ConfigRegistryEntry, RegistryError>
Supersede the active entry for id. The previous version is
pushed into history with superseded_at_ms == now_ms and the
caller-supplied change_reason. Rejected if the active entry is
Immutable.
Authorization: auth.check_policy_authz(actor, "red.registry:supersede", registry:<id>, ctx) must return true.
pub fn supersede_with_control_events( &self, auth: &AuthStore, actor: &UserId, ctx: &EvalContext, draft: ConfigRegistryDraft, change_reason: impl Into<String>, now_ms: u128, control: &ConfigRegistryControl<'_>, ) -> Result<ConfigRegistryEntry, RegistryError>
Sourcepub fn get_active(&self, id: &str) -> Option<ConfigRegistryEntry>
pub fn get_active(&self, id: &str) -> Option<ConfigRegistryEntry>
Active surface — current version for id, or None.
Sourcepub fn list_active(&self) -> Vec<ConfigRegistryEntry>
pub fn list_active(&self) -> Vec<ConfigRegistryEntry>
All currently-active entries (id-sorted for deterministic output).
Sourcepub fn history(&self, id: &str) -> Vec<ConfigRegistryHistoryRecord>
pub fn history(&self, id: &str) -> Vec<ConfigRegistryHistoryRecord>
History for id, oldest first. Empty when the id never had a
supersede (or never existed).
Trait Implementations§
Source§impl Default for ConfigRegistry
impl Default for ConfigRegistry
Source§fn default() -> ConfigRegistry
fn default() -> ConfigRegistry
Auto Trait Implementations§
impl !Freeze for ConfigRegistry
impl RefUnwindSafe for ConfigRegistry
impl Send for ConfigRegistry
impl Sync for ConfigRegistry
impl Unpin for ConfigRegistry
impl UnsafeUnpin for ConfigRegistry
impl UnwindSafe for ConfigRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request