Function to_string

Source
pub fn to_string<T>(v: &T) -> Result<String, Error>
where T: Serialize,
Expand description

Serialize data into an environment variable string.

§Example

use serde_envfile::{Value, to_string};

let value = Value::from_iter([("KEY", "VALUE")]);

let value = to_string(&value).expect("Failed to serialize to string");
println!("{}", value);