Trait SanitizeValue

Source
pub trait SanitizeValue<Trusted> {
    type Error;

    // Required method
    fn sanitize_value(self) -> Result<Trusted, Self::Error>;
}
Expand description

The type implementing this struct can be sanitized.

Calling sanitize_value() on the implementing type should return a sanitized version of the value. If the value cannot be sanitized, an error should be returned.

The sanitize_value function SHOULD clear all taint from the input.

Required Associated Types§

Source

type Error

The error type that is returned in case of a sanitization failure.

Required Methods§

Source

fn sanitize_value(self) -> Result<Trusted, Self::Error>

Sanitizes the value.

§Errors

If the sanitization fails

Implementors§

Source§

impl<E, Insecure: SanitizeValue<Insecure, Error = E>> SanitizeValue<Insecure> for MaybeUntrusted<Insecure>

Source§

type Error = E

Source§

impl<Sanitized, E, Insecure: SanitizeValue<Sanitized, Error = E>> SanitizeValue<Sanitized> for UntrustedValue<Insecure>

If the tainted data type can be sanitized using the SanitizeValue trait, implement also the SanitizeValue trait for this UntrustedValue type.

Source§

type Error = E