pub trait JsonOperations {
// Provided methods
fn read_json_with_context<T: DeserializeOwned>(
path: impl AsRef<Path>,
) -> Result<T> { ... }
fn write_json_with_context<T: Serialize>(
value: &T,
path: impl AsRef<Path>,
) -> Result<()> { ... }
}Expand description
Common JSON operations with consistent error handling
Provided Methods§
Sourcefn read_json_with_context<T: DeserializeOwned>(
path: impl AsRef<Path>,
) -> Result<T>
fn read_json_with_context<T: DeserializeOwned>( path: impl AsRef<Path>, ) -> Result<T>
Read and parse a JSON file with appropriate error context
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.