Crates.io | dbc |
lib.rs | dbc |
version | |
source | src |
created_at | 2017-07-09 05:52:25.331331 |
updated_at | 2017-07-14 19:26:43.136752 |
description | Simple design by contract assertions |
homepage | https://github.com/lpabon/rust-dbc |
repository | https://github.com/lpabon/rust-dbc |
max_upload_size | |
id | 22714 |
Cargo.toml error: | TOML parse error at line 8, column 1 | 8 | keyworks = ["dbc", "hoare", "assert"] | ^^^^^^^^ unknown field `keyworks`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Simple design by contract macros for Rust
Please see the Documentation or example for more information.
Here is a simple require!
example:
let msg = "This is a test";
let a = 3;
require!(false, msg, a);
Outputs:
panic: REQUIRE:
file: src/main.rs:45
vars:
msg="This is a test" a=3
thread 'main' panicked at 'assertion failed: false', src/main.rs:45
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at /checkout/src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at /checkout/src/libstd/sys_common/backtrace.rs:60
at /checkout/src/libstd/panicking.rs:355
3: std::panicking::default_hook
at /checkout/src/libstd/panicking.rs:371
4: std::panicking::rust_panic_with_hook
at /checkout/src/libstd/panicking.rs:549
5: std::panicking::begin_panic
at /checkout/src/libstd/panicking.rs:511
6: example::main
at ./src/main.rs:45
7: __rust_maybe_catch_panic
at /checkout/src/libpanic_unwind/lib.rs:98
8: std::rt::lang_start
at /checkout/src/libstd/panicking.rs:433
at /checkout/src/libstd/panic.rs:361
at /checkout/src/libstd/rt.rs:57
9: main
10: __libc_start_main
11: _start