Skip to main content

TargetPolicyManifest

Struct TargetPolicyManifest 

Source
pub struct TargetPolicyManifest {
    pub allow_mutating_sessions: bool,
    pub audit_capacity: u64,
    pub max_snapshot_items: u32,
    pub resources: Vec<ResourcePolicyManifest>,
    pub schema_version: u32,
}
Expand description

Target-wide ceiling policy manifest.

Fields are declared in alphabetical order to produce deterministic canonical JSON.

Fields§

§allow_mutating_sessions: bool

Whether mutating sessions may be opened.

§audit_capacity: u64

Bounded audit capacity.

§max_snapshot_items: u32

Maximum snapshot items per bounded read snapshot.

§resources: Vec<ResourcePolicyManifest>

Per-resource ceiling policies, sorted by resource ID.

§schema_version: u32

Schema version (must be 1).

Implementations§

Source§

impl TargetPolicyManifest

Source

pub fn engineering_default( resources: &BTreeMap<ResourceId, MmioResource>, ) -> Self

Default engineering ceiling policy for Phase 1 exploration.

Source

pub fn from_bundle_ceiling( resources: &BTreeMap<ResourceId, MmioResource>, ceiling: &BTreeMap<ResourceId, ResourceCeiling>, allow_mutating_sessions: bool, ) -> Self

Constructs a canonical target policy manifest from offered resources and their configured per-resource ceiling entries (including hard_denied ranges and writable_registers).

Source

pub fn canonicalize(&mut self) -> Result<(), PolicyValidationError>

Validates and canonicalizes the manifest.

Source

pub fn to_canonical_json(&self) -> Result<String, Error>

Serializes to canonical JSON.

Source

pub fn policy_digest(&self) -> Sha256Digest

Computes the canonical SHA-256 digest of the manifest.

Source

pub fn to_ceiling_map(&self) -> BTreeMap<ResourceId, ResourceCeiling>

Converts resource manifests to a ceiling map for the policy engine.

Source

pub fn narrow_with(&self, runtime: &Self) -> Result<Self, NarrowingError>

Validates that runtime narrows or preserves (does not widen) this baseline manifest. Returns the validated narrowed manifest.

Trait Implementations§

Source§

impl Clone for TargetPolicyManifest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TargetPolicyManifest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TargetPolicyManifest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for TargetPolicyManifest

Source§

impl PartialEq for TargetPolicyManifest

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for TargetPolicyManifest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TargetPolicyManifest

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.