PackageTrack
Sign in Get early access

typewit

type-witness-based abstractions, mostly for emulating polymorphism in const fns

1.15.2 17M downloads/mo #2259 most downloaded on crates.io rodrimati1992/typewit

What this package is like to depend on

Last release 4 months ago

14 Apr 2026

Release timing varies

gaps range from 9 days to 11 months

Most releases are documented

notes for 19 of 23 stable releases

1 version withdrawn

withdrawn after publishing

3 years old

24 releases · first in 2023

6 releases in the last 12 months

see the full history below

Release timeline

24 releases · Apr 2023 to Apr 2026
2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 24
  1. 1.15.2 14 Apr 2026
    Release notes

    Fixed inclusion of serde impls on docs.rs documentation

    Open source →
  2. 1.15.1 04 Apr 2026
    Release notes

    Fixed support for de/serializing into non-self-describing formats

    Open source →
  3. 1.15.0 01 Apr 2026
    Release notes

    This release adds some std and serde impls for const marker types.

    Changelog

    Added opt-in "serde" feature

    Added these impls for const marker types:

    • Default
    • Hash
    • Ord
    • PartialOrd
    • serde::Deserialize (gated on "serde" feature)
    • serde::Serialize (gated on "serde" feature)
    Open source →
    Release notes

    Added opt-in "serde" feature

    Added these impls for const marker types:

    • Default
    • Hash
    • Ord
    • PartialOrd
    • serde::Deserialize (gated on "serde" feature)
    • serde::Serialize (gated on "serde" feature)
    Open source →
  4. 1.14.2 11 Sep 2025

    Nothing published for this version

  5. 1.14.1 06 Sep 2025
    Release notes

    Fix: Added docs to simple_type_witness-generated equals method to avoid triggering missing_docs lint in downstream crates.

    Open source →
  6. 1.14.0 01 Sep 2025
    Release notes

    This release adds traits for abstracting over const markers, traits for const marker comparison, and expect_* methods to BoolWitG and TypeCmp.

    Changelog

    1.14.0

    Added expect_true and expect_false methods to typewit::const_marker::BoolWitG

    Added expect_eq and expect_ne methods to typewit::TypeCmp

    Added these items:

    • typewit::const_marker::ConstMarker trait
    • typewit::const_marker::ConstMarkerOf trait (alias for ConstMarker)

    Added these items (gated on "rust_1_83" feature):

    • typewit::const_marker::CmEquals type alias
    • typewit::const_marker::ConstMarkerEq trait
    • typewit::const_marker::ConstMarkerEqOf trait (alias for ConstMarkerEq)
    • typewit::const_marker::ConstMarkerHasWitness trait (with a blanket impl)
    • typewit::const_marker::HasConstMarker trait
    • typewit::const_marker::StdTypeEquality type

    Added ConstMarker, ConstMarkerEq impls for std-related marker types from typewit::const_marker.

    Added HasConstMarker impls for std types.

    Changed Debug impls of const marker types from only formatting their type name to delegating to the const parameter.

    Added PartialEq and Eq impls for const marker types.

    Open source →
    Release notes

    Added expect_true and expect_false methods to typewit::const_marker::BoolWitG

    Added expect_eq and expect_ne methods to typewit::TypeCmp

    Added these items:

    • typewit::const_marker::ConstMarker trait
    • typewit::const_marker::ConstMarkerOf trait (alias for ConstMarker)

    Added these items (gated on "rust_1_83" feature):

    • typewit::const_marker::CmEquals type alias
    • typewit::const_marker::ConstMarkerEq trait
    • typewit::const_marker::ConstMarkerEqOf trait (alias for ConstMarkerEq)
    • typewit::const_marker::ConstMarkerHasWitness trait (with a blanket impl)
    • typewit::const_marker::HasConstMarker trait
    • typewit::const_marker::StdTypeEquality type

    Added ConstMarker, ConstMarkerEq impls for std-related marker types from typewit::const_marker.

    Added HasConstMarker impls for std types.

    Changed Debug impls of const marker types from only formatting their type name to delegating to the const parameter.

    Added PartialEq and Eq impls for const marker types.

    Open source →
  7. 1.13.0 23 Aug 2025
    Release notes

    This release adds the map_to_arg and project_to_arg methods to TypeNe to use the fact that f(a) != f(b) implies a != b, and an Equals derive in simple_type_witness macro.

    Changelog

    1.13.0

    Added TypeNe::{map_to_arg, project_to_arg} methods.

    Added Equals derive to simple_type_witness macro, which defines equals inherent method on the type witness.

    1.12.0

    Added "generic_const_exprs" crate feature, currently only used for doc examples.

    Fixed outdated README feature section.

    Open source →
    Release notes

    Added TypeNe::{map_to_arg, project_to_arg} methods.

    Added Equals derive to simple_type_witness macro, which defines equals inherent method on the type witness.

    Open source →
  8. 1.12.1 20 Jul 2025

    Nothing published for this version

  9. 1.12.0 20 Jul 2025
    Release notes

    Added "generic_const_exprs" crate feature, currently only used for doc examples.

    Fixed outdated README feature section.

    Open source →
  10. 1.11.0 04 Dec 2024
    Release notes

    This release allows using functions that use &mut in const contexts on the latest Rust release (Rust 1.83.0).

    Changelog

    1.11.0

    Added "rust_1_83" feature, which turns typewit functions that use &mut into const fns.

    Added these methods to BoolWitG:

    • is_true
    • is_false
    • to_true
    • to_false
    • unwrap_true
    • unwrap_false

    Relaxed Copy + Clone + Debug impls of BooleanWitG to work for any <B> BooleanWitG<B>, instead of requiring <const B: bool> BoolWitG<Bool<B>>.

    1.10.1

    Fixed TypeWitnessTypeArg impl for BoolWitG, it was overconstrained in a way that made HasTypeWitness<BoolWitG<T>> not work as a bound.

    1.10.0

    Added typewit::const_marker::BoolWitG enum

    Replaced typewit::const_marker::BoolWit enum with type alias to `BoolWitG``

    Added Copy + Clone + Debug impls to BoolWit

    Fixed "adt_const_marker" crate feature

    Open source →
    Release notes

    Added "rust_1_83" feature, which turns typewit functions that use &mut into const fns.

    Added these methods to BoolWitG:

    • is_true
    • is_false
    • to_true
    • to_false
    • unwrap_true
    • unwrap_false

    Relaxed Copy + Clone + Debug impls of BooleanWitG to work for any <B> BooleanWitG<B>, instead of requiring <const B: bool> BoolWitG<Bool<B>>.

    Open source →
  11. 1.10.1 26 Nov 2024
    Release notes

    Fixed TypeWitnessTypeArg impl for BoolWitG, it was overconstrained in a way that made HasTypeWitness<BoolWitG<T>> not work as a bound.

    Open source →
  12. 1.10.0 26 Nov 2024 withdrawn
    Release notes

    Added typewit::const_marker::BoolWitG enum

    Replaced typewit::const_marker::BoolWit enum with type alias to `BoolWitG``

    Added Copy + Clone + Debug impls to BoolWit

    Fixed "adt_const_marker" crate feature

    Open source →
  13. 1.9.0 06 Jan 2024
    Release notes

    This release deprecates TypeCmp::with_any and TypeNe::with_any due to an unsoundness bug.

    Changelog

    1.9.0

    Deprecated {TypeCmp, TypeNe}::with_any due to unsoundness: both constructors rely on TypeId::of::<L>() != TypeId::of::<R>() implying L != R, which is not true in the general case.

    Open source →
    Release notes

    Deprecated {TypeCmp, TypeNe}::with_any due to unsoundness: both constructors rely on TypeId::of::<L>() != TypeId::of::<R>() implying L != R, which is not true in the general case.

    Open source →
  14. 1.8.0 05 Oct 2023
    Release notes

    This release includes many new features, with these as the main ones:

    • injective type-level functions
    • TypeCmp enum for representing "TypeEq or TypeNe"
    • Parity of TypeEq APIs in TypeNe
    • more generic free function equivalents of TypeCmp/TypeEq/TypeNe methods in methods module

    Changelog

    The changes since the 1.7 version

    1.8

    Added "rust_1_65" feature

    Added BaseTypeWitness trait, which requires "rust_1_61" feature.

    Added MetaBaseTypeWit enum, which requires "rust_1_61" feature.

    Added these items to type_fn module:

    • InjTypeFn trait
    • RevTypeFn trait
    • FnRev type-level function
    • CallInjFn type alias
    • UncallFn type alias

    Added inj_type_fn macro

    Added reexport of these in type_fn module:

    • inj_type_fn macro
    • type_fn macro

    Added TypeCmp enum

    Added these associated items to TypeEq:

    • with_any constructor
    • to_cmp method
    • unmap method
    • unproject method

    Added type_ne macro

    Added these associated items to TypeNe:

    • with_any constructor
    • with_fn constructor
    • to_cmp method
    • flip method
    • join_left method
    • join_right method
    • map method
    • project method
    • unmap method
    • unproject method
    • in_mut method
    • in_ref method
    • in_array method (requires "rust_1_61" feature)
    • zip method (requires "rust_1_61" feature)
    • zip3 method (requires "rust_1_61" feature)
    • zip4 method (requires "rust_1_61" feature)

    Removed the need to enable "const_marker" feature to enable const_marker module.

    Added equals method to all marker types in const_marker module.

    Deprecated eq methods of all marker types in const_marker module.

    Added type_constructors module, which requires "rust_1_65" and includes these items:

    • BaseTypeWitnessTc trait
    • TcTypeCmp struct
    • TcTypeEq struct
    • TcTypeNe struct
    • BaseTypeWitnessReparam type alias
    • BaseTypeWitnessToTc type alias
    • MapBaseTypeWitness type alias
    • TcToBaseTypeWitness type alias

    Added methods module, which requires "rust_1_65" and includes these items:

    • zipping module
    • in_array function
    • zip2 function
    • zip3 function
    • zip4 function

    The methods::zipping submodule (which requires "rust_1_65") contains:

    • Zip2 trait
    • Zip3 trait
    • Zip4 trait
    • Zip2Out type alias
    • Zip3Out type alias
    • Zip4Out type alias

    Added type_ne module, which contains:

    • reexport of TypeNe
    • reexport of type_ne macro
    • LeftArg marker type
    • RightArg marker type

    Added typewit_proc_macros optional dependency.

    Added "proc_macros" feature, enabled by default, which enables typewit_proc_macros dependency.

    Open source →
    Release notes

    Added "rust_1_65" feature

    Added BaseTypeWitness trait, which requires "rust_1_61" feature.

    Added MetaBaseTypeWit enum, which requires "rust_1_61" feature.

    Added these items to type_fn module:

    • InjTypeFn trait
    • RevTypeFn trait
    • FnRev type-level function
    • CallInjFn type alias
    • UncallFn type alias

    Added inj_type_fn macro

    Added reexport of these in type_fn module:

    • inj_type_fn macro
    • type_fn macro

    Added TypeCmp enum

    Added these associated items to TypeEq:

    • with_any constructor
    • to_cmp method
    • unmap method
    • unproject method

    Added type_ne macro

    Added these associated items to TypeNe:

    • with_any constructor
    • with_fn constructor
    • to_cmp method
    • flip method
    • join_left method
    • join_right method
    • map method
    • project method
    • unmap method
    • unproject method
    • in_mut method
    • in_ref method
    • in_array method (requires "rust_1_61" feature)
    • zip method (requires "rust_1_61" feature)
    • zip3 method (requires "rust_1_61" feature)
    • zip4 method (requires "rust_1_61" feature)

    Removed the need to enable "const_marker" feature to enable const_marker module.

    Added equals method to all marker types in const_marker module.

    Deprecated eq methods of all marker types in const_marker module.

    Added type_constructors module, which requires "rust_1_65" and includes these items:

    • BaseTypeWitnessTc trait
    • TcTypeCmp struct
    • TcTypeEq struct
    • TcTypeNe struct
    • BaseTypeWitnessReparam type alias
    • BaseTypeWitnessToTc type alias
    • MapBaseTypeWitness type alias
    • TcToBaseTypeWitness type alias

    Added methods module, which requires "rust_1_65" and includes these items:

    • zipping module
    • in_array function
    • zip2 function
    • zip3 function
    • zip4 function

    The methods::zipping submodule (which requires "rust_1_65") contains:

    • Zip2 trait
    • Zip3 trait
    • Zip4 trait
    • Zip2Out type alias
    • Zip3Out type alias
    • Zip4Out type alias

    Added type_ne module, which contains:

    • reexport of TypeNe
    • reexport of type_ne macro
    • LeftArg marker type
    • RightArg marker type

    Added typewit_proc_macros optional dependency.

    Added "proc_macros" feature, enabled by default, which enables typewit_proc_macros dependency.

    Open source →
  15. 1.7.0 10 Sep 2023
    Release notes

    This release adds a polymatch macro.

    (don't know how it took me until this release to start marking the releases on GitHub)

    Changelog

    All of the changelog up to this point.

    1.0

    1.7.0

    Added polymatch macro.

    1.6.0

    Added "adt_const_marker" feature.

    Added BoolWit in typewit::const_marker

    Added these structs in typewit::const_marker(under the "adt_const_marker" feature):

    • Str (unit struct)

    Added these structs in typewit::const_marker::slice(under the "adt_const_marker" feature):

    • BoolSlice (unit struct)
    • CharSlice (unit struct)
    • I8Slice (unit struct)
    • I16Slice (unit struct)
    • I32Slice (unit struct)
    • I64Slice (unit struct)
    • I128Slice (unit struct)
    • IsizeSlice (unit struct)
    • StrSlice (unit struct)
    • U8Slice (unit struct)
    • U16Slice (unit struct)
    • U32Slice (unit struct)
    • U64Slice (unit struct)
    • U128Slice (unit struct)
    • UsizeSlice (unit struct)

    Changed "nightly_mut_refs*" crate feature to enable the "rust_stable" feature.

    1.5.0

    Added support for these to simple_type_witness macro:

    • Generic parameters using < > syntax
    • Non-[ ]-surrounded where clauses
    • #[cfg(...)] attributes on variants and generic parameters
    • Using __Wit in constraints.
    • Defaulted generic parameters (only used for defaulting generic arguments in MakeTypeWitness impls)

    Added support for #[cfg(...)] attributes on generic parameters to type_fn macro.

    1.4.0

    Added Identity trait

    1.3.0

    Added type_fn macro.

    1.2.0

    Added "const_marker" feature, enabled by the default feature.

    Added const_marker module, conditional on "const_marker" feature, with these items:

    • Bool (unit struct)
    • Char (unit struct)
    • I128 (unit struct)
    • I16 (unit struct)
    • I32 (unit struct)
    • I64 (unit struct)
    • I8 (unit struct)
    • Isize (unit struct)
    • U128 (unit struct)
    • U16 (unit struct)
    • U32 (unit struct)
    • U64 (unit struct)
    • U8 (unit struct)
    • Usize (unit struct)

    Every type in const_marker defines an eq method, and implement Copy + Clone + Debug.

    Added TypeNe type, with a new_unchecked constructor function.
    TypeNe implements Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd.

    Added TypeEq::{in_array, zip, zip3, zip4} methods

    Added typewit::type_fn::FnIdentity type-level function.

    1.1.0

    Reduced Minimum Supported Rust Version to 1.57.0

    Added "rust_stable" and "rust_1_61" features

    Added type_fn::Invoke struct, which implements TypeFn.

    Removed blanket impl of TypeFn for Fn(minor breaking change)

    1.0.0

    Declared TypeEq struct, with these associated items:

    • NEW (associated constant)
    • flip (method)
    • in_box (method)
    • in_mut (method)
    • in_ref (method)
    • join (method)
    • map (method)
    • new (method)
    • new_unchecked (method)
    • project (method)
    • reachability_hint (method)
    • to_left (method)
    • to_right (method)
      TypeEq implements Clone, Copy, Debug, Default, Eq, Hash, MakeTypeWitness, Ord, PartialEq, PartialOrd, TypeWitnessTypeArg.

    Declared type_eq function.

    Declared HasTypeWitness, MakeTypeWitness, TypeWitnessTypeArg traits.

    Declared simple_type_witness macro.

    Declared type_fn module with these items:

    • TypeFn trait
    • CallFn type alias
    • GBox (structs), this implements TypeFn
    • GRef (structs), this implements TypeFn
    • GRefMut (structs), this implements TypeFn

    Declared these crate features:

    • alloc
    • mut_refs
    • nightly_mut_refs

    Set the Minimum Supported Rust Version to 1.61.0

    Open source →
    Release notes

    Added polymatch macro.

    Open source →
  16. 1.6.0 07 Sep 2023
    Release notes

    Added "adt_const_marker" feature.

    Added BoolWit in typewit::const_marker

    Added these structs in typewit::const_marker(under the "adt_const_marker" feature):

    • Str (unit struct)

    Added these structs in typewit::const_marker::slice(under the "adt_const_marker" feature):

    • BoolSlice (unit struct)
    • CharSlice (unit struct)
    • I8Slice (unit struct)
    • I16Slice (unit struct)
    • I32Slice (unit struct)
    • I64Slice (unit struct)
    • I128Slice (unit struct)
    • IsizeSlice (unit struct)
    • StrSlice (unit struct)
    • U8Slice (unit struct)
    • U16Slice (unit struct)
    • U32Slice (unit struct)
    • U64Slice (unit struct)
    • U128Slice (unit struct)
    • UsizeSlice (unit struct)

    Changed "nightly_mut_refs*" crate feature to enable the "rust_stable" feature.

    Open source →
  17. 1.5.0 23 Jul 2023
    Release notes

    Added support for these to simple_type_witness macro:

    • Generic parameters using < > syntax
    • Non-[ ]-surrounded where clauses
    • #[cfg(...)] attributes on variants and generic parameters
    • Using __Wit in constraints.
    • Defaulted generic parameters (only used for defaulting generic arguments in MakeTypeWitness impls)

    Added support for #[cfg(...)] attributes on generic parameters to type_fn macro.

    Open source →
  18. 1.4.0 13 Jun 2023
    Release notes

    Added Identity trait

    Open source →
  19. 1.3.0 24 May 2023
    Release notes

    Added type_fn macro.

    Open source →
  20. 1.2.0 18 May 2023
    Release notes

    Added "const_marker" feature, enabled by the default feature.

    Added const_marker module, conditional on "const_marker" feature, with these items:

    • Bool (unit struct)
    • Char (unit struct)
    • I128 (unit struct)
    • I16 (unit struct)
    • I32 (unit struct)
    • I64 (unit struct)
    • I8 (unit struct)
    • Isize (unit struct)
    • U128 (unit struct)
    • U16 (unit struct)
    • U32 (unit struct)
    • U64 (unit struct)
    • U8 (unit struct)
    • Usize (unit struct)

    Every type in const_marker defines an eq method, and implement Copy + Clone + Debug.

    Added TypeNe type, with a new_unchecked constructor function. TypeNe implements Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd.

    Added TypeEq::{in_array, zip, zip3, zip4} methods

    Added typewit::type_fn::FnIdentity type-level function.

    Open source →
  21. 1.1.1 30 Apr 2023

    Nothing published for this version

  22. 1.1.0 30 Apr 2023
    Release notes

    Reduced Minimum Supported Rust Version to 1.57.0

    Added "rust_stable" and "rust_1_61" features

    Added type_fn::Invoke struct, which implements TypeFn.

    Removed blanket impl of TypeFn for Fn(minor breaking change)

    Open source →
  23. 1.0.0 29 Apr 2023
    Release notes

    Declared TypeEq struct, with these associated items:

    • NEW (associated constant)
    • flip (method)
    • in_box (method)
    • in_mut (method)
    • in_ref (method)
    • join (method)
    • map (method)
    • new (method)
    • new_unchecked (method)
    • project (method)
    • reachability_hint (method)
    • to_left (method)
    • to_right (method) TypeEq implements Clone, Copy, Debug, Default, Eq, Hash, MakeTypeWitness, Ord, PartialEq, PartialOrd, TypeWitnessTypeArg.

    Declared type_eq function.

    Declared HasTypeWitness, MakeTypeWitness, TypeWitnessTypeArg traits.

    Declared simple_type_witness macro.

    Declared type_fn module with these items:

    • TypeFn trait
    • CallFn type alias
    • GBox (structs), this implements TypeFn
    • GRef (structs), this implements TypeFn
    • GRefMut (structs), this implements TypeFn

    Declared these crate features:

    • alloc
    • mut_refs
    • nightly_mut_refs

    Set the Minimum Supported Rust Version to 1.61.0

    Open source →
  24. 0.0.1 23 Apr 2023

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive