pub trait MessageLoader: Sized {
type Value;
type NestValue;
const EXTENSION: &'static str;
const NEST_VALUE_NAME: &'static str;
// Required methods
fn value_to_nest(value: Self::Value) -> Option<Self::NestValue>;
fn value_as_str(value: &Self::Value) -> Option<&str>;
fn value_from_str(content: &str) -> Result<Self::Value, String>;
fn iter_nested(
value: Self::NestValue,
) -> impl Iterator<Item = (String, Self::Value)>;
// Provided methods
fn from_path(path: ArgPath) -> Vec<LangMessage> { ... }
fn from_file(file: PathBuf) -> Vec<LangMessage> { ... }
fn from_folder(folder: PathBuf) -> Vec<LangMessage> { ... }
fn internal(
lang: &str,
hierarchy: &mut Hierarchy<String>,
value: Self::NestValue,
) -> Vec<Message> { ... }
}Required Associated Constants§
Required Associated Types§
Required Methods§
fn value_to_nest(value: Self::Value) -> Option<Self::NestValue>
fn value_as_str(value: &Self::Value) -> Option<&str>
fn value_from_str(content: &str) -> Result<Self::Value, String>
fn iter_nested( value: Self::NestValue, ) -> impl Iterator<Item = (String, Self::Value)>
Provided Methods§
fn from_path(path: ArgPath) -> Vec<LangMessage>
fn from_file(file: PathBuf) -> Vec<LangMessage>
fn from_folder(folder: PathBuf) -> Vec<LangMessage>
fn internal( lang: &str, hierarchy: &mut Hierarchy<String>, value: Self::NestValue, ) -> Vec<Message>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.