Macro arcdps_imgui::create_token

source ·
macro_rules! create_token {
    (
        $(#[$struct_meta:meta])*
        $v:vis struct $token_name:ident<'ui>;

        $(#[$end_meta:meta])*
        drop { $on_drop:expr }
    ) => { ... };
}
Expand description

This is a macro used internally by imgui-rs to create StackTokens representing various global state in DearImGui.

These tokens can either be allowed to drop or dropped manually by called end on them. Preventing this token from dropping, or moving this token out of the block it was made in can have unintended side effects, including failed asserts in the DearImGui C++.

In general, if you’re looking at this, don’t overthink these – just slap a ’_token` as their binding name and allow them to drop.