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§
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>
Sourcefn hash_imagevalue(&self) -> String
 
fn hash_imagevalue(&self) -> String
A sha256 of the filename/type/contents
Provided Methods§
fn get_limits(&self) -> Limits
Implementations on Foreign Types§
Source§impl ImageValueThings for ImageValue
 
impl ImageValueThings for ImageValue
Source§fn validate_is_png(&self) -> Result<(), ImageValidationError>
 
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>
 
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>
 
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>
 
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>
 
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
 
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