pub struct Sanitized<T: MarkerType> { /* private fields */ }Expand description
A value that has passed all sanitization rules for marker type T.
This type cannot be constructed directly — it is only produced by
Sanitizer::sanitize. This guarantees
at the type level that the inner string has been validated.
§Example
use shell_sanitize::{Sanitizer, Sanitized, ShellArg};
fn run_command(arg: &Sanitized<ShellArg>) {
// Safe to use in command construction
let _ = arg.as_str();
}Implementations§
Source§impl<T: MarkerType> Sanitized<T>
impl<T: MarkerType> Sanitized<T>
Trait Implementations§
Source§impl<T: MarkerType> Debug for Sanitized<T>
impl<T: MarkerType> Debug for Sanitized<T>
Source§impl<T: MarkerType> Display for Sanitized<T>
impl<T: MarkerType> Display for Sanitized<T>
impl<T: Eq + MarkerType> Eq for Sanitized<T>
impl<T: MarkerType> StructuralPartialEq for Sanitized<T>
Auto Trait Implementations§
impl<T> Freeze for Sanitized<T>
impl<T> RefUnwindSafe for Sanitized<T>where
T: RefUnwindSafe,
impl<T> Send for Sanitized<T>
impl<T> Sync for Sanitized<T>
impl<T> Unpin for Sanitized<T>where
T: Unpin,
impl<T> UnsafeUnpin for Sanitized<T>
impl<T> UnwindSafe for Sanitized<T>where
T: UnwindSafe,
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