pub struct BundleRegistry { /* private fields */ }Expand description
In-memory registry of policy bundles, keyed by version, scoped per tenant.
Implementations§
Source§impl BundleRegistry
impl BundleRegistry
pub fn new() -> Self
Sourcepub fn register(&self, bundle: PolicyBundle) -> Result<()>
pub fn register(&self, bundle: PolicyBundle) -> Result<()>
Register a bundle. Replaces any existing bundle at the same
(tenant, version).
Sourcepub fn latest(&self, tenant_id: &str) -> Option<PolicyBundle>
pub fn latest(&self, tenant_id: &str) -> Option<PolicyBundle>
Get the latest bundle for a tenant, if any.
Sourcepub fn at(
&self,
tenant_id: &str,
version: PolicyVersion,
) -> Option<PolicyBundle>
pub fn at( &self, tenant_id: &str, version: PolicyVersion, ) -> Option<PolicyBundle>
Get a specific version of a tenant’s bundle.
Sourcepub fn list(&self, tenant_id: &str) -> Vec<PolicyBundle>
pub fn list(&self, tenant_id: &str) -> Vec<PolicyBundle>
List all versions for a tenant, oldest first.
Trait Implementations§
Source§impl Debug for BundleRegistry
impl Debug for BundleRegistry
Source§impl Default for BundleRegistry
impl Default for BundleRegistry
Source§fn default() -> BundleRegistry
fn default() -> BundleRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for BundleRegistry
impl !RefUnwindSafe for BundleRegistry
impl Send for BundleRegistry
impl Sync for BundleRegistry
impl Unpin for BundleRegistry
impl UnwindSafe for BundleRegistry
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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