Trait kanidmd_lib::valueset::image::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

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§