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
IntegerIdandIntegerIdContiguousare safe traits, it is not possible for unsafe code to rely on them for correctness. - uint
- Defines the
UnsignedPrimInttrait and its generic operations. - utils
- Miscellaneous utilities relating to the
IntegerIdtrait.
Macros§
- define_
newtype_ counter - Defines a new type
IntegerIdCounter, which wraps anotherIntegerIdCounter - define_
newtype_ id - Defines a newtype
IntegerId, which wraps anotherIntegerId. - impl_
newtype_ id_ body - Implements the body of the
IntegerIdtrait for a newtype struct.
Traits§
- EnumId
- An
IntegerIdwhich are limited to small set of indexes. - Equivalent
Id - A type that can be for lookup as an
IntegerId. - Integer
Id - An identifier which can be sensibly converted to/from an unsigned integer value.
- Integer
IdContiguous - Indicates that an id occupies contiguous range of contiguous values,
and all values between
IntegerId::MIN_IDandIntegerId::MAX_IDare valid. - Integer
IdCounter - An
IntegerIdthat can be sensibly used as a counter, starting at aSelf::STARTvalue and being incremented from there.