pub struct EnvAllowList { /* private fields */ }Expand description
Allow access only to listed environment variable names.
use mlua_batteries::policy::EnvAllowList;
let policy = EnvAllowList::new(["HOME", "PATH", "LANG"]);Implementations§
Source§impl EnvAllowList
impl EnvAllowList
Trait Implementations§
Source§impl Debug for EnvAllowList
impl Debug for EnvAllowList
Source§impl EnvPolicy for EnvAllowList
impl EnvPolicy for EnvAllowList
Source§fn check_get(&self, key: &str) -> Result<(), PolicyError>
fn check_get(&self, key: &str) -> Result<(), PolicyError>
Validate read access to env var
key. Read moreSource§fn check_set(&self, key: &str) -> Result<(), PolicyError>
fn check_set(&self, key: &str) -> Result<(), PolicyError>
Validate write access (overlay set) to env var
key. Read moreSource§fn policy_name(&self) -> &'static str
fn policy_name(&self) -> &'static str
Human-readable name for this policy, used in
Debug output. Read moreAuto Trait Implementations§
impl Freeze for EnvAllowList
impl RefUnwindSafe for EnvAllowList
impl Send for EnvAllowList
impl Sync for EnvAllowList
impl Unpin for EnvAllowList
impl UnsafeUnpin for EnvAllowList
impl UnwindSafe for EnvAllowList
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
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>
Converts
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>
Converts
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