cc-utils 0.2.22

Rust Fullstack utils (strict error handling, `Consider` trait, MessagePack support, etc.) for Salvo and Yew/Dioxus/Leptos/*
Documentation
//! Macros for compressing data sent by the `salvo` server.

/// Brotli compression salvo's hoop.
/// 
/// Usage:
///
/// ```rust
/// use salvo::Router;
/// use cc_utils::brotli;
///
/// let router = Router::with_hoop(brotli!()).path("new-compressed-json").get(hello_compressed_json);
/// ```
#[cfg(feature = "salvo")]
#[macro_export]
macro_rules! brotli { () => {
  salvo::prelude::Compression::new()
    .disable_all()
    .enable_brotli(salvo::prelude::CompressionLevel::Minsize)
    .content_types(&[salvo::http::mime::APPLICATION_JSON])
    .force_priority(true)
    .min_length(10)
  };
}