#proc-macro #macro-derive #proc-derive

macro macron-impl-into

The implementation of trait Into

2 releases

0.1.1 May 25, 2025
0.1.0 Apr 6, 2025

#5 in #proc-derive

Download history 30/week @ 2025-09-18 41/week @ 2025-09-25 20/week @ 2025-10-02 17/week @ 2025-10-09 49/week @ 2025-10-16 30/week @ 2025-10-23 15/week @ 2025-10-30 18/week @ 2025-11-06 26/week @ 2025-11-13 21/week @ 2025-11-20 29/week @ 2025-11-27 24/week @ 2025-12-04 19/week @ 2025-12-11 33/week @ 2025-12-18 23/week @ 2025-12-25 46/week @ 2026-01-01

127 downloads per month
Used in 8 crates (via macron)

MIT license

7KB
76 lines

githubcrates-iodocs-rs

Impl Into Macro

Introduction:

The implementation of trait Into.

P.s.: More useful macros you can find here.

Examples:

#[derive(Into, Debug, PartialEq)]
#[into(Insertion, "self.insertion")]
struct Test {
    insertion: Insertion,
}

#[derive(Debug, PartialEq)]
struct Insertion;

assert_eq!(Insertion {}, Test { insertion: Insertion {} }.into());
#[derive(Into, Debug, PartialEq)]
#[into(Insertion, "match self { Self::Insertion(ins) => ins }")]
enum Test {
    Insertion(Insertion),
}

#[derive(Debug, PartialEq)]
struct Insertion;

assert_eq!(Insertion {}, Test::Insertion(Insertion {}).into());

Licensing:

Distributed under the MIT license.

Feedback:

You can contact me via GitHub or send a message to my Telegram @fuderis.

This library is constantly evolving, and I welcome your suggestions and feedback.

Dependencies

~140–540KB
~13K SLoC