firedbg-lib

Crates.iofiredbg-lib
lib.rsfiredbg-lib
version0.1.2
sourcesrc
created_at2023-10-30 11:43:02.82968
updated_at2023-12-08 11:47:42.402676
descriptionFireDBG Support Library
homepagehttps://firedbg.sea-ql.org/
repositoryhttps://github.com/SeaQL/FireDBG.for.Rust
max_upload_size
id1018392
size4,856
Chris Tsang (tyt2y3)

documentation

https://docs.rs/firedbg-lib

README

FireDBG Support Library

fire::dbg!

This macro allows you to capture the value of a variable via runtime inspection in FireDBG.

Usage example:

use firedbg_lib::fire;

fn some_fn(v: i32) -> i32 {
    fire::dbg!(v) + 1
}

fn other_fn(v: i32) -> i32 {
    fire::dbg!("arg_v", v) + 1
}

Which fire::dbg!(v) would expand to __firedbg_trace__("v", v) when compiled under debug mode. The label could be customized, which fire::dbg!("arg_v", v) would expand to __firedbg_trace__("arg_v", v). In release mode, it would expand to an expression passing through the value, i.e. { v }.

Note that the function passes through the ownership of the variable, just like the std::dbg! macro.

fn __firedbg_trace__<T>(name: &'static str, v: T) -> T { v }
Commit count: 62

cargo fmt