This crate provides marker traits for primitive types:
```toml
[dependencies] just_prim = { version = "0.1.0" }
[features]
markertraitattr = ["justprim/markertrait_attr"] ```
```rust // Uncomment if you want to conditionally use the feature. Remove otherwise. // #![cfgattr(feature = "markertraitattr", feature(markertrait_attr))]
use just_prim::Prim;
trait MyExtensionTraitForPrimTys: Prim { // ... }
fn main() {} ```
cargo build <other options> --features marker_trait_attr
if you want the feature and cargo build <other options>
otherwise;cargo run<other options> --features marker_trait_attr
if you want the feature and cargo build <other options>
otherwise;cargo test <other options> --features marker_trait_attr
if you want the feature and cargo test <other options>
otherwise.With marker_trait_attr
Nightly feature, each of the provided traits also has #[marker]
attribute which allows more optimal implementation of traits via two or more "overlapping" generic impl
blocks. Without #[marker]
attribute, the "overlapping" impl
blocks would be conflicting.
epui
- Equisized (primitive) unsigned ints for primitive ints: u8 for u8, u16 for i16, etcepsi
- Equisized (primitive) signed ints for primitive intsprimitive_promotion
- Primitive promotions for primitive numeric types: u16 for u8, i32 for i16, f64 for f32, etcis_signed_trait
- Trait for IS_SIGNED
associated constantmax_len_base_10_as_usize
- Trait offering constant maximum lengths of primitive integers as usizemin_max_traits
- Traits for MIN
and MAX
associated constantsLicensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.