cartulary 0.3.0-alpha.1

The knowledge layer of your project — decisions, issues, docs, all in one place.
Documentation
use super::SitePath;

/// A binary site entry — theme files (CSS, JS, fonts), images, and
/// any companion attachment copied through verbatim.
///
/// `bytes` is opaque; the writer adapter does not interpret content.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SiteAsset {
    pub path: SitePath,
    pub bytes: Vec<u8>,
}

impl SiteAsset {
    pub fn new(path: SitePath, bytes: Vec<u8>) -> Self {
        SiteAsset { path, bytes }
    }
}

#[cfg(test)]
pub mod strategy {
    use super::*;
    use proptest::prelude::*;

    pub fn site_asset() -> impl Strategy<Value = SiteAsset> {
        (
            super::super::site_path::strategy::site_path(),
            proptest::collection::vec(any::<u8>(), 0..200),
        )
            .prop_map(|(path, bytes)| SiteAsset::new(path, bytes))
    }
}