fnaop
fnaop is a lightweight and flexible Rust library designed to bring Aspect-Oriented Programming (AOP) to your Rust
functions. By using fnaop, you can easily add pre and post function logic without modifying the core functionality
of your functions, enabling cleaner and more maintainable code.
1.Usage
Add this to your Cargo.toml:
[]
= "0.1"
2.APIs
Aspect:
An attribute macro for applying Aspect-Oriented Programming (AOP) to functions. The Aspect macro allows you to
specify before and after functions that will be called before and after the target function respectively. This is
useful for encapsulating cross-cutting concerns such as logging, metrics, or other side effects.
2.1.Noarmal
Ordinary function, adapted to 0 or more ordinary parameters.
// ----------------------------------------------------------------
2.2.Lifetime
Functions with lifetime parameters.
2.3.Return value
Functions with return values.
2.4.Others
…
// @see integration_tests.rs