Function xmt::nest

source · []
pub fn nest<T, F: FnOnce() -> T>(message: &str, func: F) -> T
Expand description

Execute the provided closure in a nested scope within the global XMT instance.

Example

xmt::init_default();
xmt::print!("Hello");
xmt::nest("Begin nested scope", || {
    xmt::print!("Within scope");
});

// Prints:
// Hello
// Begin nested scope
//   Within scope