Crate intid_core

Crate intid_core 

Source
Expand description

Defines the IntegerId trait, for types that can be identified by an integer value.

This contains all the same types that the intid crate does, but has no dependency on intid_derive (even when the intid/derive feature is enabled). This reduces compile times, similar to the separation between serde_core and serde introduced in serde-rs/serde#2608.

It may be convenient to rename the intid_core dependency to intid using dependency renaming.

intid = { version = "0.3", package = "intid_core" }

This renaming comes at no loss of clarity, since the items in intid_core are simply a subset of the items in the intid crate. If for some reason you decide to use intid_derive directly without depending on intid, then you will need to do this renaming since the derived code references the intid crate.

Re-exports§

pub use uint::UnsignedPrimInt;

Modules§

trusted
Since IntegerId and IntegerIdContiguous are safe traits, it is not possible for unsafe code to rely on them for correctness.
uint
Defines the UnsignedPrimInt trait and its generic operations.
utils
Miscellaneous utilities relating to the IntegerId trait.

Macros§

define_newtype_counter
Defines a new type IntegerIdCounter, which wraps another IntegerIdCounter
define_newtype_id
Defines a newtype IntegerId, which wraps another IntegerId.
impl_newtype_id_body
Implements the body of the IntegerId trait for a newtype struct.

Traits§

EnumId
An IntegerId which are limited to small set of indexes.
EquivalentId
A type that can be for lookup as an IntegerId.
IntegerId
An identifier which can be sensibly converted to/from an unsigned integer value.
IntegerIdContiguous
Indicates that an id occupies contiguous range of contiguous values, and all values between IntegerId::MIN_ID and IntegerId::MAX_ID are valid.
IntegerIdCounter
An IntegerId that can be sensibly used as a counter, starting at a Self::START value and being incremented from there.