pub struct BindingIndex {
server: String,
bound: HashMap<PolicyId, Vec<Coverage>>,
names: HashMap<PolicyId, String>,
}Expand description
Whom each policy in a tree is bound to, by the tree’s own id for it.
A policy with no entry is unbound — compiled in, or supplied at startup
— and applies to every account. A policy with an entry applies within
a Boundary one of its coverages reaches, and one with an empty entry
applies to nobody.
Fields§
§server: String§bound: HashMap<PolicyId, Vec<Coverage>>§names: HashMap<PolicyId, String>Each policy’s id in the build: {key}/{statement}/{action} for a
record, the name for a built-in.
Implementations§
Source§impl BindingIndex
impl BindingIndex
Sourcepub fn of(
server: &str,
bindings: &BTreeMap<String, PolicyBinding>,
ids: &BTreeMap<String, Vec<String>>,
registered: &HashMap<String, PolicyId>,
) -> (Self, Vec<String>)
pub fn of( server: &str, bindings: &BTreeMap<String, PolicyBinding>, ids: &BTreeMap<String, Vec<String>>, registered: &HashMap<String, PolicyId>, ) -> (Self, Vec<String>)
The index over one build’s records: every declaration registered
holds a tree position for, carrying the reach of every binding that
names the record it was declared from.
ids is the declaration ids each policy record was declared under
— crate::set::Read::ids. Also returns the record keys no binding
names, in key order: compiled, and applied to nobody.
Sourcepub fn name_of(&self, policy: PolicyId) -> Option<&str>
pub fn name_of(&self, policy: PolicyId) -> Option<&str>
The id policy was registered under, for a refusal that names it.
Trait Implementations§
Source§impl Clone for BindingIndex
impl Clone for BindingIndex
Source§fn clone(&self) -> BindingIndex
fn clone(&self) -> BindingIndex
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BindingIndex
impl Debug for BindingIndex
Source§impl Default for BindingIndex
impl Default for BindingIndex
Source§fn default() -> BindingIndex
fn default() -> BindingIndex
Auto Trait Implementations§
impl Freeze for BindingIndex
impl RefUnwindSafe for BindingIndex
impl Send for BindingIndex
impl Sync for BindingIndex
impl Unpin for BindingIndex
impl UnsafeUnpin for BindingIndex
impl UnwindSafe for BindingIndex
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,
§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>
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