INNER CODE UNIT · Rust
as_json
zkonduit/ezkl · src/lib.rs:422
pub fn as_json(&self) -> Result<String, Box<dyn std::error::Error>> {
let res = serde_json::to_string(&self)?;
Ok(res)
}
/// Parses configuration from JSON
///
/// Deserializes a RunArgs instance from a JSON string
///
/// # Arguments
/// * `arg_json` - JSON string containing configuration
///
/// # Returns
/// * `Ok(RunArgs)` if parsing succeeds
/// * `Err` if parsing fails
pub fn from_json(arg_json: &str) -> Result<Self, serde_json::Error> {
serde_json::from_str(arg_json)
}