pub struct ShellCommandPolicy {
pub always_forbidden: Vec<char>,
pub forbidden_unquoted: Vec<char>,
}Expand description
Context-aware shell command policy.
Replaces the flat forbidden_chars with structured classification that
respects quoting context.
Fields§
§always_forbidden: Vec<char>Characters that are ALWAYS forbidden, even inside quotes.
forbidden_unquoted: Vec<char>Characters forbidden only when they appear unquoted.
Implementations§
Source§impl ShellCommandPolicy
impl ShellCommandPolicy
Sourcepub fn from_legacy_forbidden_chars(chars: &str) -> Self
pub fn from_legacy_forbidden_chars(chars: &str) -> Self
Build from the legacy flat forbidden_chars string.
Sourcepub fn validate_token(&self, chars: &[AnnotatedChar]) -> Result<()>
pub fn validate_token(&self, chars: &[AnnotatedChar]) -> Result<()>
Validate annotated characters from a single token.
Trait Implementations§
Source§impl Clone for ShellCommandPolicy
impl Clone for ShellCommandPolicy
Source§fn clone(&self) -> ShellCommandPolicy
fn clone(&self) -> ShellCommandPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShellCommandPolicy
impl Debug for ShellCommandPolicy
Auto Trait Implementations§
impl Freeze for ShellCommandPolicy
impl RefUnwindSafe for ShellCommandPolicy
impl Send for ShellCommandPolicy
impl Sync for ShellCommandPolicy
impl Unpin for ShellCommandPolicy
impl UnsafeUnpin for ShellCommandPolicy
impl UnwindSafe for ShellCommandPolicy
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