dureuill / delegable-derive

Experimental proc macro to delegate the implementation of some trait to a field or function.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

delegable-derive

Experimental proc macro to delegate the implementation of some traits to a field or function.

Requires nightly.

Usage

See the companion test repository.

Examples

See the examples directory, that contains the following examples:

  • my_into: a delegable implementation of an Into-like trait. Demonstrates that the macro works with names that are overloaded like into() (also, generic parameter).
  • vec_facade: a delegable trait that implements the inherent methods of Vec. It is easy to have a "vector-like" struct by implementing the delegate trait for the VecFacade trait.

About

Experimental proc macro to delegate the implementation of some trait to a field or function.

License:MIT License


Languages

Language:Rust 100.0%