pub fn from_json<R: io::Read>(reader: R) -> Result<Self, CreationManifestError> {
        match serde_json::from_reader::<R, VersionedCreationManifest>(reader)? {
            VersionedCreationManifest::Version1(v1) => Ok(CreationManifest::from_v1(v1.check()?)),
        }
    }
/// Deserializes a `CreationManifest` from versioned json.
///
/// # Examples
/// ```
/// # use fuchsia_pkg::CreationManifest;
/// let json_string = r#"
/// {
///   "version": "1",
///   "content": {
///     "/": {
///       "lib/mylib.so": "build/system/path/mylib.so"
///     },
///    "/meta/": {
///      "my_component_manifest.cmx": "other/build/system/path/my_component_manifest.cmx"
///    }
/// }"#;
/// let creation_manifest = CreationManifest::from_json(json_string.as_bytes());
/// ```
Deserializes a `CreationManifest` from versioned json.
Deserializes a ` CreationManifest ` from versioned json .
pub fn from_json<R: io::Read>(reader: R) -> Result<Self, CreationManifestError> {
        match serde_json::from_reader::<R, VersionedCreationManifest>(reader)? {
            VersionedCreationManifest::Version1(v1) => Ok(CreationManifest::from_v1(v1.check()?)),
        }
    }
pub fn from_json < R : io :: Read > ( reader : R ) -> Result < Self , CreationManifestError > { match serde_json :: from_reader :: < R , VersionedCreationManifest > ( reader ) ? { VersionedCreationManifest :: Version1 ( v1 ) => Ok ( CreationManifest :: from_v1 ( v1 . check ( ) ? ) ) , } }
Deserializes a `CreationManifest` from versioned json.
Deserializes a ` CreationManifest ` from versioned json .
reader
R
reader
R
examples
None
use fuchsia_pkg::creationmanifest;
let json_string = r#"
{
"version": "1",
"content": {
"/": {
"lib/mylib.so": "build/system/path/mylib.so"
},
"/meta/": {
"my_component_manifest.cmx": "other/build/system/path/my_component_manifest.cmx"
}
}"#;
let creation_manifest = CreationManifest::from_json(json_string.as_bytes());
```
let json_string = r# " { " version " : " 1 " " content " : { " / " : { " lib / mylib . so " : " build / system / path / mylib . so " } " / meta / " : { " my_component_manifest . cmx " : " other / build / system / path / my_component_manifest . cmx " } } " # ; let creation_manifest = CreationManifest :: from_json ( json_string . as_bytes () ) ; ` ` `