#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

#418 in Rust patterns

Download history 416/week @ 2024-01-26 438/week @ 2024-02-02 711/week @ 2024-02-09 687/week @ 2024-02-16 565/week @ 2024-02-23 793/week @ 2024-03-01 843/week @ 2024-03-08 728/week @ 2024-03-15 638/week @ 2024-03-22 867/week @ 2024-03-29 563/week @ 2024-04-05 762/week @ 2024-04-12 506/week @ 2024-04-19 644/week @ 2024-04-26 534/week @ 2024-05-03 509/week @ 2024-05-10

2,344 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