Skip to main content

PolicyProjection

Struct PolicyProjection 

Source
pub struct PolicyProjection<'a> { /* private fields */ }
Expand description

A policy’s rules spelled for one harness, in profile order.

Implementations§

Source§

impl<'a> PolicyProjection<'a>

Source

pub fn rules(&self) -> &[(&'a ToolRule, ProjectedRule)]

Source

pub fn default_action(&self) -> Option<ToolAction>

What a tool no rule names gets: the strictest * rule’s action, or None without one.

Source

pub fn natives(&self, action: ToolAction, kind: RuleKind) -> Vec<String>

Native names of the kind rules with action, built-in tools first, each name once.

Source

pub fn available(&self) -> Vec<String>

Names of every allow and ask rule, taken before coverage and conflict resolution cleared any: the tools an allowlist must keep available. A deny that beats one of them is written beside the list, never by emptying it.

Source

pub fn gaps( &self, action: ToolAction, kind: RuleKind, ) -> Vec<(String, &'static str)>

Each kind rule with action that Mars could not name, as the author wrote it, with why.

Trait Implementations§

Source§

impl Serialize for PolicyProjection<'_>

The published shape of a projection (project in the WASM package): per rule, then the native names each action ends with. A consumer decides from these what to warn about: a status other than known, a covered_by or a note is something the author may not have meant.

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Forget for PolicyProjection<'a>

§

impl<'a> Freeze for PolicyProjection<'a>

§

impl<'a> Move for PolicyProjection<'a>

§

impl<'a> RefUnwindSafe for PolicyProjection<'a>

§

impl<'a> Send for PolicyProjection<'a>

§

impl<'a> Sync for PolicyProjection<'a>

§

impl<'a> Unpin for PolicyProjection<'a>

§

impl<'a> UnsafeUnpin for PolicyProjection<'a>

§

impl<'a> UnwindSafe for PolicyProjection<'a>

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, !>

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.