| //! codegenerated rust flag lib |
| |
| /// flag provider |
| pub struct FlagProvider; |
| |
| lazy_static::lazy_static! \{ |
| {{ for flag in template_flags }} |
| /// flag value cache for {flag.name} |
| static ref CACHED_{flag.name}: bool = flags_rust::GetServerConfigurableFlag( |
| "aconfig_flags.{flag.device_config_namespace}", |
| "{flag.device_config_flag}", |
| "false") == "true"; |
| {{ endfor }} |
| } |
| |
| impl FlagProvider \{ |
| {{ for flag in template_flags }} |
| /// query flag {flag.name} |
| pub fn {flag.name}(&self) -> bool \{ |
| *CACHED_{flag.name} |
| } |
| {{ endfor }} |
| |
| } |
| |
| /// flag provider |
| pub static PROVIDER: FlagProvider = FlagProvider; |
| |
| {{ for flag in template_flags }} |
| /// query flag {flag.name} |
| #[inline(always)] |
| pub fn {flag.name}() -> bool \{ |
| PROVIDER.{flag.name}() |
| } |
| {{ endfor }} |