Crate diagnostics_tools

Source
Expand description

§Module :: diagnostics_tools

experimental rust-status docs.rs Open in Gitpod discord

Diagnostics tools.

§Basic use-case

#[ test ]
#[ should_panic ]
fn a_id_panic_test()
{
  a_id!( 1, 2 );
  /*
    print :
    ...

thread 'a_id_panic_test' panicked at 'assertion failed: `(left == right)`

Diff < left / right > :
<1
>2
...
  */
}

§To add to your project

cargo add diagnostics_tools

§Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/diagnostics_tools_trivial
cargo run

Modules§

dependency
Namespace with dependencies.
diag
Compile-time asserting.
exposed
Exposed namespace of the module.
orphan
Orphan namespace of the module.
own
Own namespace of the module.
prelude
Prelude to use essentials: use my_module::prelude::*.

Macros§

a_dbg_false
Asserts that a boolean expression is false at runtime.
a_dbg_id
Asserts that two expressions are identical.
a_dbg_not_id
Asserts that two expressions are not identical with each other.
a_dbg_true
Asserts that a boolean expression is true at runtime.
a_false
Asserts that a boolean expression is false at runtime.
a_id
Asserts that two expressions are identical to each other (using PartialEq). Prints nice diff.
a_not_id
Asserts that two expressions are not identical to each other (using PartialEq). Prints nice diff.
a_true
Asserts that a boolean expression is true at runtime.
cta_mem_same_size
Compile-time assertion that two values have the same size.
cta_ptr_same_size
Compile-time assertion that memory behind two references have the same size.
cta_true
Macro to compare meta condition is true at compile-time.
cta_type_same_align
Compile-time assertion of having the same align.
cta_type_same_size
Compile-time assertion that two types have the same size.