fundle_macros 0.2.0

Procedural macros for the fundle crate.
Documentation

Fundle Macros

crate.io docs.rs MSRV CI Coverage License

Summary

Procedural macros to support the fundle crate. See fundle for more information.

Macros

#[bundle]

Transforms structs into type-safe builders with dependency injection support.

#[fundle::bundle]
pub struct AppState {
   logger: Logger,
   database: Database,
}

Generates builder methods and a select macro for dependency access.

#[deps]

Creates dependency parameter structs with automatic From<T> implementations.

#[fundle::deps]
pub struct ServiceDeps {
    logger: Logger,
    database: Database,
}

Generates From<T> where T: AsRef<Logger> + AsRef<Database>.

#[newtype]

Creates newtype wrappers with automatic trait implementations.

#[newtype]
pub struct DatabaseLogger(Logger);

Generates Clone, From<T: AsRef<Logger>>, Deref, and DerefMut.

This crate was developed as part of The Oxidizer Project.