pub struct SecureArgParser;Expand description
Secure argument parser
Provides security-first parsing with comprehensive validation.
Implementations§
Source§impl SecureArgParser
impl SecureArgParser
Sourcepub fn validate_argument(arg: &str) -> Result<(), ParseError>
pub fn validate_argument(arg: &str) -> Result<(), ParseError>
Validate a single argument for security issues
§Errors
ArgumentTooLongif exceeds max lengthDangerousPatternif contains dangerous patterns
Sourcepub fn validate_path(path: &str) -> Result<PathBuf, ParseError>
pub fn validate_path(path: &str) -> Result<PathBuf, ParseError>
Sourcepub fn validate_optional_path(
path: Option<&str>,
) -> Result<Option<PathBuf>, ParseError>
pub fn validate_optional_path( path: Option<&str>, ) -> Result<Option<PathBuf>, ParseError>
Validate an optional path (may be None)
Sourcepub fn validate_number<T>(
arg_name: &str,
value: &str,
min: Option<T>,
max: Option<T>,
) -> Result<T, ParseError>
pub fn validate_number<T>( arg_name: &str, value: &str, min: Option<T>, max: Option<T>, ) -> Result<T, ParseError>
Validate a number argument
Auto Trait Implementations§
impl Freeze for SecureArgParser
impl RefUnwindSafe for SecureArgParser
impl Send for SecureArgParser
impl Sync for SecureArgParser
impl Unpin for SecureArgParser
impl UnwindSafe for SecureArgParser
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