pub struct RuntimeInventory { /* private fields */ }Expand description
Deployment-side mapping from a pinned runtime role label to the file that fills it. Paths are deployment data and never enter the versioned rules: the expected hashes live in the rules, and the jailed worker re-hashes every supplied file against them immediately before use, so a swap after parent-side validation still fails closed. Roles are validated against the known label set, so a typo fails loudly instead of silently leaving a role unfilled.
Implementations§
Source§impl RuntimeInventory
impl RuntimeInventory
Sourcepub fn empty() -> RuntimeInventory
pub fn empty() -> RuntimeInventory
An inventory with no roles filled: every engine path stays on its fail-closed runtime-missing seam.
Sourcepub fn known_roles() -> impl Iterator<Item = &'static str>
pub fn known_roles() -> impl Iterator<Item = &'static str>
Every role label a deployment may fill.
Sourcepub fn set(&mut self, role: &str, path: PathBuf) -> Result<()>
pub fn set(&mut self, role: &str, path: PathBuf) -> Result<()>
Fills one role with the absolute path of a literal regular file. A directory or a symlink is refused here, before it can become a broader jail capability, and the spawn path re-asserts the same rule right before every run.
Sourcepub fn path(&self, role: &str) -> Option<&Path>
pub fn path(&self, role: &str) -> Option<&Path>
The path filling a role, when the deployment supplied one.
Sourcepub fn parse(text: &str, name: &str) -> Result<RuntimeInventory>
pub fn parse(text: &str, name: &str) -> Result<RuntimeInventory>
Parses an inventory from TOML text: one flat table mapping each role label to an absolute path.
Sourcepub fn load(path: &Path) -> Result<RuntimeInventory>
pub fn load(path: &Path) -> Result<RuntimeInventory>
Loads an inventory from a TOML file.
Trait Implementations§
Source§impl Clone for RuntimeInventory
impl Clone for RuntimeInventory
Source§impl Debug for RuntimeInventory
impl Debug for RuntimeInventory
Auto Trait Implementations§
impl Freeze for RuntimeInventory
impl RefUnwindSafe for RuntimeInventory
impl Send for RuntimeInventory
impl Sync for RuntimeInventory
impl Unpin for RuntimeInventory
impl UnsafeUnpin for RuntimeInventory
impl UnwindSafe for RuntimeInventory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more