pub struct TeMatrix { /* private fields */ }Expand description
The compiled type-enforcement matrix: a flat allow-set of TeRules. Default-deny —
any triple not present is denied. This is the data-plane artifact loaded from signed
compiled policy (see crate::mac::compiled). Kept as a HashSet so the hot-path
lookup is O(1); it is also the unit S5 produces and compiled signs.
Optionally carries an escalation-set: triples that, while not permitted, are eligible
for a ceiling-amendment (design §8). A triple in neither set is a hard Deny.
Implementations§
Source§impl TeMatrix
impl TeMatrix
Sourcepub fn new(allow: HashSet<TeRule>, escalate: HashSet<TeRule>) -> Self
pub fn new(allow: HashSet<TeRule>, escalate: HashSet<TeRule>) -> Self
Build from explicit allow/escalate rule sets (the shape S5’s compiler emits).
Sourcepub fn from_allow(allow: impl IntoIterator<Item = TeRule>) -> Self
pub fn from_allow(allow: impl IntoIterator<Item = TeRule>) -> Self
Build an allow-only matrix (no escalation band).
Sourcepub fn allow_len(&self) -> usize
pub fn allow_len(&self) -> usize
Number of allow rules (for diagnostics / matrix hashing sanity).
Sourcepub fn sorted_rules(&self) -> (Vec<TeRule>, Vec<TeRule>)
pub fn sorted_rules(&self) -> (Vec<TeRule>, Vec<TeRule>)
Sorted-vec projection of the allow/escalate sets, for canonical (order-stable)
encoding/hashing in crate::mac::compiled. Returns (allow, escalate); the caller
sorts. The hot path never calls this.
Sourcepub fn te_decision(&self, rule: TeRule) -> Decision
pub fn te_decision(&self, rule: TeRule) -> Decision
Raw TE decision for a triple, without the lattice floor. Total + default-deny. Pure on the matrix contents — this is the part S5 produces policy for.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TeMatrix
impl<'de> Deserialize<'de> for TeMatrix
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TeMatrix
impl RefUnwindSafe for TeMatrix
impl Send for TeMatrix
impl Sync for TeMatrix
impl Unpin for TeMatrix
impl UnsafeUnpin for TeMatrix
impl UnwindSafe for TeMatrix
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§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 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