#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

#422 in Rust patterns

Download history 363/week @ 2024-01-18 380/week @ 2024-01-25 441/week @ 2024-02-01 643/week @ 2024-02-08 754/week @ 2024-02-15 640/week @ 2024-02-22 714/week @ 2024-02-29 889/week @ 2024-03-07 640/week @ 2024-03-14 732/week @ 2024-03-21 679/week @ 2024-03-28 709/week @ 2024-04-04 737/week @ 2024-04-11 557/week @ 2024-04-18 674/week @ 2024-04-25 419/week @ 2024-05-02

2,469 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
~19K SLoC