Trait FromTrustedVariant

Source
pub trait FromTrustedVariant<OtherInsecure> {
    // Required method
    fn from_untrusted_variant(other: OtherInsecure) -> Self;
}
Expand description

This trait provides a way to convert an untrusted or trusted type to another untrusted type.

See also IntoUntrustedVariant. This trait is the inverse of IntoUntrustedVariant. This trait is automatically implemented for all types that implement IntoUntrustedVariant.

You don’t need to implement this trait manually.

Required Methods§

Source

fn from_untrusted_variant(other: OtherInsecure) -> Self

Converts the provided type to an equivalent untrusted type.

No sanitization is done here, only the conversion to an untrusted type.

This function MUST guarantee the following properties:

  1. The conversion result MUST NOT contain untainted data that was tainted in the input.
  2. The conversion MUST NOT do any sanitization.
  3. If the input is not tainted, all parts of the output MUST be tainted.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Insecure, OtherInsecure> FromTrustedVariant<OtherInsecure> for Insecure
where OtherInsecure: IntoUntrustedVariant<Insecure>,

Implement this trait for all types that implement IntoUntrustedVariant.