Banner

Crates.io Downloads Build Status rustc ^1.37.0
Become a Patron! Buy me a coffee

Compile-time assertions for Rust, brought to you by Nikolai Vazquez.

This library lets you ensure correct assumptions about constants, types, and more. See the [docs] and FAQ for more info!

Installation

This crate is available on crates.io and can be used by adding the following to your project's Cargo.toml:

toml [dependencies] static_assertions = "1.1.0"

and this to your crate root (main.rs or lib.rs):

```rust

[macro_use]

extern crate static_assertions; ```

Usage

This crate exposes the following macros: - [assert_cfg!] - [assert_eq_align!] - [assert_eq_size!] - [assert_eq_size_ptr!] - [assert_eq_size_val!] - [assert_fields!] - [assert_impl_all!] - [assert_impl_any!] - [assert_impl_one!] - [assert_not_impl_all!] - [assert_not_impl_any!] - [assert_obj_safe!] - [assert_trait_sub_all!] - [assert_trait_super_all!] - [assert_type_eq_all!] - [assert_type_ne_all!] - [const_assert!] - [const_assert_eq!] - [const_assert_ne!]

FAQ

Changes

See CHANGELOG.md for a complete list of what has changed from one version to another.

License

This project is released under either:

at your choosing.