Skip to main content

set_batch

Macro set_batch 

Source
macro_rules! set_batch {
    ($( $rtype:ident, $id:literal, $source:expr), *) => { ... };
}
Expand description

Macro to set a batch of settings in one go in an efficient way.

It expects a list of the following:

  • $rtype: The setting’s setter (set_bool, set_i32, etc.)
  • $id: The ID of the setting as a string literal.
  • $source: The expression to get the value.

You can add more settings by adding another 3 arguments to the macro.