crypsol_storage 0.2.0

Multi-cloud storage library for Rust with image processing, validation, and thumbnail generation. Supports AWS S3, GCS, Azure Blob, Cloudflare R2, MinIO, and local filesystem.
Documentation
/// Custom error type for storage-related failures.
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
    #[error("Backend configuration error: {0}")]
    ConfigError(String),

    #[error("Backend error: {0}")]
    Backend(String),

    #[error("Invalid file type: {0}. Allowed types: {1}")]
    InvalidFileType(String, String),

    #[error("File size exceeds maximum allowed: {0} bytes (max: {1} bytes)")]
    FileTooLarge(usize, usize),

    #[error("Image processing error: {0}")]
    ImageProcessing(String),

    #[error("Output image dimensions {0}x{1} exceed maximum allowed {2}x{2}")]
    InvalidDimensions(u32, u32, u32),

    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),

    #[error("Invalid presign expiry: {0}s (valid range: 1..={1}s)")]
    InvalidExpiry(u64, u64),

    #[error("Presigned URLs are not supported by this backend")]
    PresignNotSupported,
}