Skip to main content

ProtectionReport

Struct ProtectionReport 

Source
pub struct ProtectionReport {
    pub mapping: ProtectionState,
    pub memory_lock: ProtectionState,
    pub dump_exclusion: ProtectionState,
    pub fork: ForkProtectionReport,
    pub guard_pages: ProtectionState,
    pub canary: ProtectionState,
    pub cache_policy: ProtectionState,
    pub requested_bytes: usize,
    pub mapped_bytes: usize,
    pub locked_bytes: usize,
    pub page_granule: usize,
    pub lock_quota_likely: bool,
}
Expand description

Runtime report retained by a mapped secret container.

Fields§

§mapping: ProtectionState

Private mapping or compatibility storage outcome.

§memory_lock: ProtectionState

Page-lock outcome.

§dump_exclusion: ProtectionState

Core-dump exclusion outcome.

§fork: ForkProtectionReport

Process-fork behavior outcome.

§guard_pages: ProtectionState

Guard-page outcome.

§canary: ProtectionState

Canary integrity outcome.

§cache_policy: ProtectionState

Persistent cache-policy outcome.

§requested_bytes: usize

Secret payload bytes requested by the caller.

§mapped_bytes: usize

Bytes in the owned platform mapping.

§locked_bytes: usize

Bytes successfully locked against ordinary paging.

§page_granule: usize

Page granule used for mapping arithmetic, or zero for compatibility storage without host page control.

§lock_quota_likely: bool

Whether a lock failure code is commonly associated with a lock quota or working-set limit.

Implementations§

Source§

impl ProtectionReport

Source

pub const fn satisfies(&self, request: ProtectionRequest) -> bool

Returns whether the mapping is live and every requested control was established or did not apply to empty storage.

This is stricter than construction success: a failed or unsupported Requirement::Preferred control returns false, even though construction may legitimately have returned a live reduced-protection container. Controls marked Requirement::NotRequested are ignored.

Source

pub const fn all_requested_controls_established( &self, request: ProtectionRequest, ) -> bool

Returns whether every requested control was established or did not apply to empty storage.

This compatibility spelling is equivalent to ProtectionReport::satisfies.

Source

pub const fn is_degraded(&self) -> bool

Returns whether this report records reduced or unusable protection.

A failed, unsupported, or compatibility-only control is degraded. NotApplicable is accepted only when requested_bytes is zero; for nonempty storage it indicates a released or missing control and is degraded. Unrequested controls are ignored.

Source

pub const fn memory_is_locked(&self) -> bool

Returns whether the page-lock control was established.

Empty storage reports NotApplicable and therefore returns false.

Source

pub const fn guard_pages_established(&self) -> bool

Returns whether inaccessible guard pages were established.

Empty storage reports NotApplicable and therefore returns false.

Source

pub fn failed_or_unsupported_controls( &self, ) -> impl Iterator<Item = ProtectionControl>

Iterates over controls that failed, are unsupported, or are available only through a reduced-guarantee compatibility backend.

The iterator allocates no memory and yields controls in stable report order: mapping, memory lock, dump exclusion, fork policy, guard pages, canary, and cache policy. NotRequested controls are omitted. NotApplicable is omitted only for genuinely empty storage and is reported as unavailable for nonempty storage.

Trait Implementations§

Source§

impl Clone for ProtectionReport

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 Copy for ProtectionReport

Source§

impl Debug for ProtectionReport

Source§

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

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

impl Eq for ProtectionReport

Source§

impl PartialEq for ProtectionReport

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 StructuralPartialEq for ProtectionReport

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> 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> 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.