3 unstable releases

0.2.1 Aug 23, 2023
0.2.0 Jan 15, 2023
0.1.0 Oct 18, 2021

#449 in #storage

Download history 9/week @ 2024-07-22 30/week @ 2024-07-29 29/week @ 2024-08-05 13/week @ 2024-08-12 8/week @ 2024-08-19 22/week @ 2024-08-26 8/week @ 2024-09-02 6/week @ 2024-09-09 9/week @ 2024-09-16 28/week @ 2024-09-23 56/week @ 2024-09-30 32/week @ 2024-10-07 13/week @ 2024-10-14 12/week @ 2024-10-21 10/week @ 2024-10-28 10/week @ 2024-11-04

52 downloads per month
Used in stratisd

MPL-2.0 license

14KB
241 lines

stratisd_proc_macros

This crate is currently used to hold procedural macros for stratisd used to reduce boilerplate code through code generation.

#[strat_pool_impl_gen]

This macro is meant to be attached to an impl... StratPool item. It will add

Attributes

#[pool_rollback]: This attribute attached to a method in the impl block indicates that Stratis should monitor the return value of this method for potential rollback failures and, if detected, should put the pool in maintenance only mode until the rollback failure is corrected. All methods that need to handle a pool rollback by definition must take a &mut self reference so that the maintenance mode flag may be set on rollback failure.

#[pool_mutatating_action(STATE)]: This attribute attached to a method in the impl block indicates that this action can mutate the internal state of the pool. This includes any changes to the underlying data structures or metadata on the device. All methods that take a &mut self reference are by definition mutating actions. However, there may also be methods with a &self reference that are also mutating actions. STATE corresponds to a variant of the ActionAvailability enum such as Full, NoRequests, etc.

Dependencies

~1.5MB
~37K SLoC