#phantom-data #send #unpin #sync #send-sync #restrictions

no-std phantom-type

A PhantomData analog which prevents “parameter is never used” error, but does not produce any restrictions in contrast with PhantomData

8 releases (4 breaking)

0.5.0 Mar 13, 2024
0.4.2 May 24, 2022
0.3.1 Jun 25, 2021
0.3.0 Sep 21, 2020
0.1.0 Sep 21, 2020

#408 in Rust patterns

Download history 236/week @ 2024-01-03 324/week @ 2024-01-10 312/week @ 2024-01-17 385/week @ 2024-01-24 324/week @ 2024-01-31 563/week @ 2024-02-07 896/week @ 2024-02-14 574/week @ 2024-02-21 735/week @ 2024-02-28 783/week @ 2024-03-06 769/week @ 2024-03-13 697/week @ 2024-03-20 717/week @ 2024-03-27 770/week @ 2024-04-03 583/week @ 2024-04-10 557/week @ 2024-04-17

2,693 downloads per month
Used in 16 crates (8 directly)

MIT/Apache

4KB

maintenance: passively maintained

phantom-type

A PhantomData analog which prevents "parameter is never used" error, but does not produce any restrictions in contrast with PhantomData.

Optional no_std

If your crate has std feature, use the following method to specify phantom-type dependency:

[features]
default = ["std"]
std = ["phantom-type/std"]

[dependencies]
phantom-type = { version = "*", default-features = false }

lib.rs:

Crate features

  • "std" Enabled by default. Disable to make the library #![no_std].

Dependencies

~0.3–0.8MB
~20K SLoC