const-struct-version 0.2.0

A trait plus proc-macro to generate a hash based on the fields of a struct. Useful for intelligently expiring a cache when the stored object changes.
Documentation
#![allow(dead_code)]

use const_struct_version::StructVersion;

#[derive(StructVersion)]
struct GenericContainer<T> {
    value: T,
    items: Vec<T>,
}

#[derive(StructVersion)]
struct ConcreteType {
    data: GenericContainer<u32>,
}

#[test]
fn test_generic_struct() {
    let version = <ConcreteType as StructVersion>::version();
    insta::assert_debug_snapshot!(version);
}