#constructor #ctor #attributes

macro small_ctor

A minimal, dependency free version of the ctor crate

3 releases

0.1.2 Aug 1, 2024
0.1.1 Jul 2, 2023
0.1.0 Jan 22, 2022

#907 in Procedural macros

Download history 295/week @ 2024-10-27 500/week @ 2024-11-03 252/week @ 2024-11-10 179/week @ 2024-11-17 221/week @ 2024-11-24 216/week @ 2024-12-01 504/week @ 2024-12-08 598/week @ 2024-12-15 18/week @ 2024-12-22 42/week @ 2024-12-29 194/week @ 2025-01-05 190/week @ 2025-01-12 222/week @ 2025-01-19 213/week @ 2025-01-26 353/week @ 2025-02-02 595/week @ 2025-02-09

1,384 downloads per month
Used in 33 crates (2 directly)

Apache-2.0

17KB
229 lines

small-ctor

Build Status rustc 1.46.0 Crates.io License Documentation

Minimal, dependency free implementation of the ctor crate.

Supports Rust 1.46 and later on Linux, Windows and macOS. Other platforms best effort.

struct MyPlugin;

#[small_ctor::ctor]
unsafe fn register_plugin() {
    PLUGINS.register(MyPlugin);
}

No runtime deps