pub struct EnvGuard { /* private fields */ }Expand description
The policy applied to a set of secrets before they reach a child.
Implementations§
Source§impl EnvGuard
impl EnvGuard
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
The policy --allow-unsafe-env selects.
Sourcepub fn check(self, name: &str) -> Result<(), GuardError>
pub fn check(self, name: &str) -> Result<(), GuardError>
Checks a single name against the policy.
§Errors
Returns GuardError::LoaderControlled for a name the loader or a
language runtime interprets, unless the guard is permissive.
Sourcepub fn check_all<'a>(
self,
names: impl IntoIterator<Item = &'a str>,
) -> Result<(), GuardError>
pub fn check_all<'a>( self, names: impl IntoIterator<Item = &'a str>, ) -> Result<(), GuardError>
Checks every name, failing on the first refusal.
Fails the whole launch rather than dropping the offending variable: a child started with a silently missing variable is a debugging problem, and a child started with a silently present one is a breach.
§Errors
See EnvGuard::check.
Trait Implementations§
impl Copy for EnvGuard
impl Eq for EnvGuard
impl StructuralPartialEq for EnvGuard
Auto Trait Implementations§
impl Freeze for EnvGuard
impl RefUnwindSafe for EnvGuard
impl Send for EnvGuard
impl Sync for EnvGuard
impl Unpin for EnvGuard
impl UnsafeUnpin for EnvGuard
impl UnwindSafe for EnvGuard
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
Mutably borrows from an owned value. Read more