Skip to main content

from_str

Function from_str 

Source
pub fn from_str<A, F>(
    toml_str: &str,
    resolve: F,
) -> Result<BuildOutput<A>, BuildError>
where F: FnMut(&str) -> Option<A>,
Expand description

Builds a Keymap from a TOML string.

The [keys] table maps key strings (see keymap_core::KeyInput’s FromStr) to action names; resolve turns each action name into the caller’s action type A, returning None for names it does not recognize.

§Errors

Returns BuildError if the input is not valid TOML, or if any key string fails to parse. Unknown action names and chord conflicts are not errors — they are returned in BuildOutput::warnings.