Skip to main content

ProtectedContext

Struct ProtectedContext 

Source
pub struct ProtectedContext { /* private fields */ }

Implementations§

Source§

impl ProtectedContext

Source

pub fn load(path: &Path) -> Result<Self, &'static str>

Legacy development raw context only; never inferred as versioned.

Source

pub fn load_versioned(path: &Path) -> Result<Self, &'static str>

Canonical versioned context, held from the original open. Exact wrapper bytes are the snapshot and config digest, not reserialized inner bytes.

Source

pub fn from_held_versioned( path: &Path, file: File, ) -> Result<Self, &'static str>

Takes ownership of the original read-only CLOEXEC config descriptor. Path is checked for identity only, never reopened for config bytes. Reads at explicit offsets, independent of the caller’s shared cursor.

Source

pub fn is_versioned(&self) -> bool

Source

pub fn revalidate(&self) -> Result<(), &'static str>

Source

pub fn socket_file(&self) -> Result<&File, &'static str>

Borrow the held Linux O_PATH socket handle after revalidation. A transport may connect through /proc/self/fd/N to avoid reopening the ambient path. This alone is not peer authentication or a mutation capability.

Source

pub fn snapshot(&self) -> Result<(&ExpectedContext, &[u8]), &'static str>

Source

pub fn config_sha256(&self) -> Result<String, &'static str>

Source§

impl ProtectedContext

Source

pub fn capture_image_for_plan<F>( &self, id: &str, get: F, ) -> Result<CapturedImage, &'static str>
where F: FnMut(&str) -> Result<(u16, Vec<u8>), &'static str>,

Capture exact bounded evidence only after protected info/image/info. An eventual record constructor must accept this type, never ImageFacts.

Source

pub fn inspect_with<F>( &self, id: &str, get: F, ) -> Result<InspectOutcome, &'static str>
where F: FnMut(&str) -> Result<(u16, Vec<u8>), &'static str>,

No retry, mutation or lease authority. Even an exact Missing result is withheld until the final info observation and filesystem check succeed.

Source

pub fn inspect_owned_with<F>( &self, owner: &ExpectedContainer, get: F, ) -> Result<State, &'static str>
where F: FnMut(&str) -> Result<(u16, Vec<u8>), &'static str>,

Selected ownership facts under the same protected observation sequence. The expected plan still requires durable installation/slot binding.

Source

pub fn inspect_image_with<F>( &self, id: &str, get: F, ) -> Result<ImageFacts, &'static str>
where F: FnMut(&str) -> Result<(u16, Vec<u8>), &'static str>,

Image facts are returned only after matching both protected observations.

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