pub struct PolicyStoreLayout { /* private fields */ }Expand description
Validated configuration for namespace-partitioned policy stores.
Policies are assigned from the configured namespace references in their
scope constraints and conditions. Policies whose @id value is registered
as global, or which carry
@treetop_store("*"), are installed in every store. An otherwise unscoped
policy can use @treetop_store("store-id") for an explicit assignment.
Entity namespaces outside every configured store may be shared across
stores; they do not participate in assignment or request routing.
Implementations§
Source§impl PolicyStoreLayout
impl PolicyStoreLayout
Sourcepub fn new(
stores: impl IntoIterator<Item = PolicyStoreConfig>,
) -> Result<Self, PolicyError>
pub fn new( stores: impl IntoIterator<Item = PolicyStoreConfig>, ) -> Result<Self, PolicyError>
Create a layout containing non-overlapping store namespaces.
Sourcepub fn with_global_policy_ids<I, S>(
self,
policy_ids: I,
) -> Result<Self, PolicyError>
pub fn with_global_policy_ids<I, S>( self, policy_ids: I, ) -> Result<Self, PolicyError>
Register policy @id values that must be installed in every store.
Every registered ID must exist in the loaded policy source. This catches stale or misspelled global-policy assignments during snapshot creation.
Sourcepub fn stores(&self) -> &[PolicyStoreConfig]
pub fn stores(&self) -> &[PolicyStoreConfig]
Return the configured stores in declaration order.
Trait Implementations§
Source§impl Clone for PolicyStoreLayout
impl Clone for PolicyStoreLayout
Source§fn clone(&self) -> PolicyStoreLayout
fn clone(&self) -> PolicyStoreLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PolicyStoreLayout
impl RefUnwindSafe for PolicyStoreLayout
impl Send for PolicyStoreLayout
impl Sync for PolicyStoreLayout
impl Unpin for PolicyStoreLayout
impl UnsafeUnpin for PolicyStoreLayout
impl UnwindSafe for PolicyStoreLayout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more