Skip to main content

GateInput

Struct GateInput 

Source
pub struct GateInput<'a, E: AsRef<str> + Ord> {
    pub all: &'a [String],
    pub display: &'a HashMap<String, String>,
    pub hash: &'a HashMap<String, String>,
    pub inferred: &'a HashMap<String, BTreeSet<E>>,
    pub calls: &'a HashMap<String, BTreeSet<String>>,
    pub hosts: &'a HashMap<String, BTreeSet<String>>,
    pub cmds: &'a HashMap<String, BTreeSet<String>>,
    pub paths: &'a HashMap<String, BTreeSet<String>>,
    pub tables: &'a HashMap<String, BTreeSet<String>>,
    pub surface_incomplete: &'a HashMap<String, BTreeSet<E>>,
    pub reason_classes: &'a HashMap<String, BTreeSet<String>>,
    pub net_classes: &'a HashMap<String, Vec<String>>,
}

Fields§

§all: &'a [String]

Every UNIT the gate ranges over, in the caller’s order — an opaque KEY, not necessarily a name.

§display: &'a HashMap<String, String>

⟨0.32⟩ key -> the name to MATCH and DISPLAY. Empty means the keys are already names.

A multi-report gate must join by hash and never by bare fn (SPEC §2.2), because two members of a workspace legitimately share a name — and merging them was measured turning a refusal into policy ✓ by letting one borrow the other’s Unknown reason class. But a hash is package#fn, and a POLICY SCOPE is written against the name (deny Exec app::), so keying by hash without this map silently stops scopes matching: a false green introduced by fixing a false green. Identity is the default, so the single-report callers are unaffected.

§hash: &'a HashMap<String, String>

⟨0.32⟩ key -> the §2.2 UNIT IDENTITY (package#fn) a verdict row carries. Missing means this caller has none, and the row then omits the field — see Self::unit.

§inferred: &'a HashMap<String, BTreeSet<E>>

Per fn, the TRANSITIVE effect set — the model’s S, with candor’s Unknown marker carried as a member (this engine’s encoding of D ≠ ∅).

§calls: &'a HashMap<String, BTreeSet<String>>

The call graph AS-EFF-009 walks.

§hosts: &'a HashMap<String, BTreeSet<String>>

Per fn, the TRANSITIVE literal surface AS-EFF-008 certifies against.

§cmds: &'a HashMap<String, BTreeSet<String>>§paths: &'a HashMap<String, BTreeSet<String>>§tables: &'a HashMap<String, BTreeSet<String>>§surface_incomplete: &'a HashMap<String, BTreeSet<E>>

Per fn, the effects whose literal surface is structurally INCOMPLETE — the AS-EFF-008 fail-closed marker, without which a benign visible literal masks an invisible forbidden endpoint.

§reason_classes: &'a HashMap<String, BTreeSet<String>>

Per fn, the TRANSITIVE reason-class tokens — the model’s D (§6.2 ⟨0.19⟩). The Unknown EFFECT propagates along the call graph, so its REASON must too: else deny E Unknown[reflect] at a caller inheriting Unknown from a reflect-caused callee sees no class and does NOT fire.

§net_classes: &'a HashMap<String, Vec<String>>

Per Net-bearing fn, its ⟨0.20⟩ destination classes, ALREADY derived — by net_classes_of on the scan route, read verbatim from the report’s netClass on the report route. Absent ⇒ empty.

Implementations§

Source§

impl<'a, E: AsRef<str> + Ord> GateInput<'a, E>

⟨0.24⟩ THE GATE’S INPUT — one signature per function, every field already TRANSITIVE.

E is the effect-name representation: &'static str on the scan route (the classifier’s interned vocabulary) and String on the report route (the wire’s names, taken VERBATIM — a report naming an effect this build’s vocabulary does not list must still trip a pure rule, so the names are never filtered through a known-effect allowlist on the way in).

Source

pub fn disp<'x>(&'x self, k: &'x str) -> &'x str

The name to match a policy scope against, and to print. Identity when no map was supplied.

Source

pub fn unit<'x>(&'x self, k: &'x str) -> &'x str

⟨0.32⟩ The §2.2 UNIT IDENTITY this key stands for — what a verdict row carries so a consumer can tell two units apart (SPEC §2). EMPTY when the caller has none to give, and empty is then omitted from the wire: this producer cannot answer beats a fabricated id.

A separate map from Self::display rather than a second use of the key, because the two routes disagree about what the key IS: the report route keys by hash already, the scan route keys by the qualified NAME and must qualify it with the crate. Reading identity off the key would have made the two routes emit different hash values for one unit, which §3.1 byte-equality forbids and which no single-route test could see.

Auto Trait Implementations§

§

impl<'a, E> Freeze for GateInput<'a, E>
where &'a HashMap<String, BTreeSet<E>>: Freeze,

§

impl<'a, E> RefUnwindSafe for GateInput<'a, E>

§

impl<'a, E> Send for GateInput<'a, E>
where &'a HashMap<String, BTreeSet<E>>: Send,

§

impl<'a, E> Sync for GateInput<'a, E>
where &'a HashMap<String, BTreeSet<E>>: Sync,

§

impl<'a, E> Unpin for GateInput<'a, E>
where &'a HashMap<String, BTreeSet<E>>: Unpin,

§

impl<'a, E> UnsafeUnpin for GateInput<'a, E>

§

impl<'a, E> UnwindSafe for GateInput<'a, E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.