Trait ConfigClientHost
pub trait ConfigClientHost {
// Provided methods
fn translate(&self, key: &str) -> Option<String> { ... }
fn setting_bool(&self, key: &str) -> Option<bool> { ... }
fn setting_choice(&self, key: &str) -> Option<u32> { ... }
fn setting_f64(&self, key: &str) -> Option<f64> { ... }
fn setting_color(&self, key: &str) -> Option<u32> { ... }
}Expand description
The client host’s methods of the config area, implemented by the game and reached through crate::ClientHost.
Provided Methods§
fn translate(&self, key: &str) -> Option<String>
fn translate(&self, key: &str) -> Option<String>
Side: client.
The selected language’s text for a translation key (Component.translatable’s lookup), None
when no language layer defines it.
fn setting_bool(&self, key: &str) -> Option<bool>
fn setting_bool(&self, key: &str) -> Option<bool>
Side: client.
The calling mod’s toggle key (Registrar::register_setting): the player’s choice, else
its default. None when the mod registered no toggle by that key.
fn setting_choice(&self, key: &str) -> Option<u32>
fn setting_choice(&self, key: &str) -> Option<u32>
Side: client.
The index of the option the player picked for the calling mod’s choice key, else its
default. None when the mod registered no choice by that key.
fn setting_f64(&self, key: &str) -> Option<f64>
fn setting_f64(&self, key: &str) -> Option<f64>
Side: client.
The calling mod’s range key: the player’s value, else its default; a kept value outside
the range reads as the default. None when the mod registered no range by that key.
fn setting_color(&self, key: &str) -> Option<u32>
fn setting_color(&self, key: &str) -> Option<u32>
Side: client.
The calling mod’s colour key, 0xRRGGBB: the player’s choice, else its default. None
when the mod registered no colour by that key.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".