pub trait SanitizeWith<Insecure, Trusted> {
// Required method
fn sanitize_with<Sanitizer, Error>(
self,
sanitizer: Sanitizer,
) -> Result<Trusted, Error>
where Sanitizer: FnOnce(Insecure) -> Result<Trusted, Error>;
}Expand description
This type can be sanitized using a provided sanitizer.
This trait will be implemented automatically for structs
generated by the #[derive(UntrustedVariant)] macro.
The sanitize_with function SHOULD clear all taint from the input.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<Insecure, Trusted> SanitizeWith<Insecure, Trusted> for MaybeUntrusted<Insecure, Trusted>
impl<Insecure, Trusted> SanitizeWith<Insecure, Trusted> for UntrustedValue<Insecure>
Taint can be cleared from the value by using a sanitizer. Effectively unpacking the value; passing it to the sanitizer and returning the result.