Skip to content

v0.9.6

Compare
Choose a tag to compare
@drmingdrmer drmingdrmer released this 25 Apr 10:03
· 175 commits to main since this release

Summary:

  • Added:
    • 5776139d Add #[since(version="1.0")] to specify first version of a feature.
    • b172dc8e Add macro expand!() to expand a template.
  • Improved:
    • 99596c75 declare_raft_types allows the types in any order.
  • Fixed:
    • 14d42e4f Load mebmership since last_applied, not last_membership.index on startup.

Detail:

Added:

  • Added: 5776139d Add #[since(version="1.0")] to specify first version of a feature; by 张炎泼; 2024-04-12

    #[since(version = "1.0.0")] adds a doc line /// Since: Version(1.0.0).

    Example:

    /// Foo function
    ///
    /// Does something.
    #[since(version = "1.0.0")]
    fn foo() {}

    The above code will be transformed into:

    /// Foo function
    ///
    /// Does something.
    ///
    /// Since: Version(1.0.0)
    fn foo() {}
  • Added: b172dc8e Add macro expand!() to expand a template; by 张炎泼; 2024-04-13

    expand!() renders a template with arguments multiple times.

    Example:

    expand!(KEYED, // ignore duplicate by `K`
            (K, T, V) => {let K: T = V;},
            (a, u64, 1),
            (a, u32, 2), // duplicate `a` will be ignored
            (c, Vec<u8>, vec![1,2])
    );

    The above code will be transformed into:

    let a: u64 = 1;
    let c: Vec<u8> = vec![1, 2];

Improved:

  • Improved: 99596c75 declare_raft_types allows the types in any order; by 张炎泼; 2024-04-13

    By rewriting the template expanding part with a #[proc_macro]
    expand!() defined in openraft_macros, declare_raft_types
    does not require the types in fixed order:

    Example:

    declare_raft_types!(All:
            D = (),
            NodeId = u64,
            R = (),
            Node = (),
    

Fixed:

  • Fixed: 14d42e4f Load mebmership since last_applied, not last_membership.index on startup; by 张炎泼; 2024-04-25

    Modify StorageHelper::last_membership_in_log() to scan the log
    starting from the last applied index rather than the index of the last
    applied membership log. This change reduces unnecessary I/O operations
    during startup, previously caused by scanning from an incorrect starting
    point.