Skip to main content

save

Function save 

Source
pub fn save<T: Serialize>(
    value: &T,
    path: impl AsRef<Path>,
    format: Format,
    key: &str,
) -> Result<(), Error>
Expand description

Writes value to path as the key section of a format document.

The format is taken from the argument rather than the extension, so a file named config or .myapprc can still be written.

§Errors

If value cannot be serialized, the format’s feature is not enabled, or the file cannot be written.