Skip to main content

hot_path

Macro hot_path 

Source
macro_rules! hot_path {
    () => { ... };
    ($section:expr) => { ... };
}
Expand description

Macro to mark a function as hot path.

This is a convenience macro that creates a HotPathGuard at the start of the function with the function name as the section.

§Example

use laminar_core::hot_path;

fn process_event(event: &Event) {
    hot_path!();
    // Hot path code...
}

// Or with a custom section name:
fn custom_section() {
    hot_path!("custom::section::name");
    // Hot path code...
}