Skip to content

v0.1.1: Derive Macros + Documentation Improvements

Compare
Choose a tag to compare
@ecton ecton released this 11 Feb 22:21
· 424 commits to main since this release
013aab6

Thanks goes to @ModProg for his contributions on the new derive macros!

This release contains no breaking changes.

Added

  • SchemaName:private and CollectionName::private are two new constructors
    that allow defining names without specifying an authority. Developers
    creating reusable collections and/or schemas should not use these methods as
    namespacing is meant to help prevent name collisions.

  • connection::Collection::all() and SchemaCollection::all() have been
    implemented as simple wrappers around list(..).

  • #146, #187: The Schema, Collection, and View traits can
    now be derived rather than manually implemented:

    #[derive(Debug, Schema)]
    #[schema(name = "my-schema", collections = [Shape])]
    struct MySchema;
    
    #[derive(Debug, Serialize, Deserialize, Collection)]
    #[collection(name = "shapes", views = [ShapesByNumberOfSides])]
    struct Shape {
        pub sides: u32,
    }
    
    #[derive(Debug, Clone, View)]
    #[view(collection = Shape, key = u32, value = usize, name = "by-number-of-sides")]
    struct ShapesByNumberOfSides;
  • #169: Memory-only instances of Storage can be created now. This is primarily intended for testing purposes.

Changed

  • Inline examples have been added for every connection::Collection and
    connection::View function.
  • All examples have been updated to the new derive macro syntax. Additionally,
    documentation and examples for deriving Schema, Collection, and View have been
    added to the respective traits.