Skip to main content

ImageValueThings

Trait ImageValueThings 

Source
pub trait ImageValueThings {
    // Required methods
    fn validate_image(&self) -> Result<(), ImageValidationError>;
    fn validate_is_png(&self) -> Result<(), ImageValidationError>;
    fn validate_is_gif(&self) -> Result<(), ImageValidationError>;
    fn validate_is_jpg(&self) -> Result<(), ImageValidationError>;
    fn validate_is_webp(&self) -> Result<(), ImageValidationError>;
    fn validate_is_svg(&self) -> Result<(), ImageValidationError>;
    fn hash_imagevalue(&self) -> String;

    // Provided method
    fn get_limits(&self) -> Limits { ... }
}

Required Methods§

Provided Methods§

Source

fn get_limits(&self) -> Limits

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ImageValueThings for ImageValue

Source§

fn validate_is_png(&self) -> Result<(), ImageValidationError>

Validate the PNG file contents, and that it’s actually a PNG

Source§

fn validate_is_jpg(&self) -> Result<(), ImageValidationError>

validate the JPG file contents, and that it’s actually a JPG

Source§

fn validate_is_gif(&self) -> Result<(), ImageValidationError>

validate the GIF file contents, and that it’s actually a GIF

Source§

fn validate_is_svg(&self) -> Result<(), ImageValidationError>

validate the SVG file contents, and that it’s actually a SVG (ish)

Source§

fn validate_is_webp(&self) -> Result<(), ImageValidationError>

validate the WebP file contents, and that it’s actually a WebP file (as far as we can tell)

Source§

fn hash_imagevalue(&self) -> String

A sha256 of the filename/type/contents, uses openssl so has to live here because proto don’t need that jazz

Source§

fn validate_image(&self) -> Result<(), ImageValidationError>

Implementors§