Rust method delegation with less boilerplate
This crate is designed to remove boilerplate for structs that delegate some of their methods to one or more of their fields. It provides the delegate! macro which allows for method calls to be delegated to selected expressions, usually inner fields. This crate is useful for reducing code repetition and making code more concise.
#[await(true/false)] attribute to specify whether await should be generated after the delegated expression.#[inline(always)] attribute, unless specified otherwise.The Delegate crate provides a convenient way to reduce boilerplate for structs that delegate methods to their fields. It offers features such as delegation to methods with different names, arbitrary field expressions, enum variants, method body modifiers, additional arguments, async function support, and more. This crate is a useful tool for improving code readability and reducing repetition in Rust projects.