MultiType
MultiType is Rust a crate for generalising fundamental types via traits.
MultiType provides traits such as Unsigned and FloatingPoint to abstract
over a set of equivalent primitive types. These traits are intended to provide
one-to-one copies of the primary interfaces that the primitive types define.
Overview
The complete list of abstraction traits is:
ArithmeticIntegralSignedUnsigned
FloatingPoint
Examples
A generic Fibonacci sequence:
use Uint;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Feature gates
Default features:
allocstd
Dependency features:
alloc: Enables compatibility withallocfacilitiesstd: Enables compatibility withstdfacilities
Unstable features:
f16: Enables support forf16f128: Enables support forf128unstable_docs: Enables unstable documentation features
Unstable gates can be expected to be removed as their facilities stabilise.
MSRV policy
The goal of MultiType is to provide generic traits that bind as much of the standard interfaces as possible. Items that are added after the MSRV will be backported.
Copyright and licence
Copyright © 2025-2026 Gabriel Bjørnager Jensen.
MultiType is distributed under either an MIT licence (see LICENCE-MIT) or
version 2.0 of the Apache License (see LICENCE-APACHE), at your option.