Feature: Add #[since(version="1.0")] to specify first version of a feature#[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() {}
Feature: Add macro expand!() to expand a templateexpand!() 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];
Improve: declare_raft_types allows the types in any order
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 = (),
Refactor: fix since for ClientWriteResponse methods
Dep: use fixed version 1.0.79 for proc-macro2
proc-macro2 1.0.80 produces an error:
Error: --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.80/src/wrapper.rs:871:21
|
871 | proc_macro::Literal::byte_character(byte)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #115268 <https://github.com/rust-lang/rust/issues/115268> for more information
= help: add `#![feature(proc_macro_byte_character)]` to the crate attributes to enable
= note: this compiler was built on 2024-03-19; consider upgrading it if it is out of date
Test: Add test to macros::since and macros::expand
Refactor: rename WriteResult to ClientWriteResultWriteResult is public but is sealed behind a private mod,
thus this is not a breaking change.
Chore: refactor Inflight
Refactor: LogIdRange: use prev, last instead of prev_log_id, last_log_id
Doc: get_snapshot_builder() is a method of RaftStateMachine
Fix: Load mebmership since last_applied, not last_membership.index on startup
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.
Dep: relax proc-macros2 version requirement
Refactor: move DataWithId to sub mod utils::WithId
Refactor: remove request_id
M openraft/src/engine/handler/replication_handler/mod.rs
Chore: adjust info log
Doc: Add FAQ: store additional info in Node
Feature: Add
#[since(version="1.0")]
to specify first version of a feature#[since(version = "1.0.0")]
adds a doc line/// Since: Version(1.0.0)
.Example:
The above code will be transformed into:
Feature: Add macro
expand!()
to expand a templateexpand!()
renders a template with arguments multiple times.Example:
The above code will be transformed into:
Improve:
declare_raft_types
allows the types in any order By rewriting the template expanding part with a#[proc_macro]
expand!()
defined inopenraft_macros
,declare_raft_types
does not require the types in fixed order:Example:
Refactor: fix since for ClientWriteResponse methods
Dep: use fixed version 1.0.79 for proc-macro2 proc-macro2 1.0.80 produces an error:
Test: Add test to
macros::since
andmacros::expand
Refactor: rename
WriteResult
toClientWriteResult
WriteResult
is public but is sealed behind a private mod, thus this is not a breaking change.Chore: refactor Inflight
Refactor: LogIdRange: use prev, last instead of prev_log_id, last_log_id
Doc: get_snapshot_builder() is a method of RaftStateMachine
Fix: Load mebmership since
last_applied
, notlast_membership.index
on startup ModifyStorageHelper::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.Dep: relax proc-macros2 version requirement
Refactor: move
DataWithId
to sub modutils::WithId
Refactor: remove request_id
M openraft/src/engine/handler/replication_handler/mod.rs