// Creates a data model with a ZBI containing 4 component manifests and a default component id index.
// The structure of the component instance tree is:
//
//        root
//       /    \
//     foo    bar
//     /
//   baz
//
Creates a data model with a ZBI containing 4 component manifests and a default component id index.
The structure of the component instance tree is.

root
\
foo    bar

baz
Creates a data model with a ZBI containing 4 component manifests and a default component id index . The structure of the component instance tree is . root \ foo bar baz
fn multi_v2_component_model() -> Result<Arc<DataModel>> {
        let model = data_model();
        let root_id = 0;
        let foo_id = 1;
        let bar_id = 2;
        let baz_id = 3;
        let root_url = DEFAULT_ROOT_URL.to_string();
        let foo_url = "fuchsia-boot:///#meta/foo.cm".to_string();
        let bar_url = "fuchsia-boot:///#meta/bar.cm".to_string();
        let baz_url = "fuchsia-boot:///#meta/baz.cm".to_string();
        let root_component = make_v2_component(root_id, root_url.clone());
        let foo_component = make_v2_component(foo_id, foo_url.clone());
        let bar_component = make_v2_component(bar_id, bar_url.clone());
        let baz_component = make_v2_component(baz_id, baz_url.clone());
        let root_decl = new_component_decl(vec![
            new_child_decl("foo".to_string(), foo_url),
            new_child_decl("bar".to_string(), bar_url),
        ]);
        let foo_decl = new_component_decl(vec![new_child_decl("baz".to_string(), baz_url)]);
        let bar_decl = new_component_decl(vec![]);
        let baz_decl = new_component_decl(vec![]);
        let root_manifest = make_v2_manifest(root_id, root_decl)?;
        let foo_manifest = make_v2_manifest(foo_id, foo_decl)?;
        let bar_manifest = make_v2_manifest(bar_id, bar_decl)?;
        let baz_manifest = make_v2_manifest(baz_id, baz_decl)?;
        let deps = hashset! { CORE_DEP_STR.to_string() };
        model.set(Components::new(vec![
            root_component,
            foo_component,
            bar_component,
            baz_component,
        ]))?;
        model.set(Manifests::new(vec![root_manifest, foo_manifest, bar_manifest, baz_manifest]))?;
        model.set(Zbi { ..zbi(None, None, component_id_index::Index::default()) })?;
        model.set(CoreDataDeps { deps })?;
        Ok(model)
    }
fn multi_v2_component_model ( ) -> Result < Arc < DataModel > > { let model = data_model ( ) ; let root_id = 0 ; let foo_id = 1 ; let bar_id = 2 ; let baz_id = 3 ; let root_url = DEFAULT_ROOT_URL . to_string ( ) ; let foo_url = " " . to_string ( ) ; let bar_url = " " . to_string ( ) ; let baz_url = " " . to_string ( ) ; let root_component = make_v2_component ( root_id , root_url . clone ( ) ) ; let foo_component = make_v2_component ( foo_id , foo_url . clone ( ) ) ; let bar_component = make_v2_component ( bar_id , bar_url . clone ( ) ) ; let baz_component = make_v2_component ( baz_id , baz_url . clone ( ) ) ; let root_decl = new_component_decl ( vec ! [ new_child_decl ( " " to_string ( ) foo_url ) new_child_decl ( " " to_string ( ) bar_url ) ] ) ; let foo_decl = new_component_decl ( vec ! [ new_child_decl ( " " to_string ( ) baz_url ) ] ) ; let bar_decl = new_component_decl ( vec ! [ ] ) ; let baz_decl = new_component_decl ( vec ! [ ] ) ; let root_manifest = make_v2_manifest ( root_id , root_decl ) ? ; let foo_manifest = make_v2_manifest ( foo_id , foo_decl ) ? ; let bar_manifest = make_v2_manifest ( bar_id , bar_decl ) ? ; let baz_manifest = make_v2_manifest ( baz_id , baz_decl ) ? ; let deps = hashset ! { CORE_DEP_STR to_string ( ) } ; model . set ( Components :: new ( vec ! [ root_component foo_component bar_component baz_component ] ) ) ? ; model . set ( Manifests :: new ( vec ! [ root_manifest foo_manifest bar_manifest baz_manifest ] ) ) ? ; model . set ( Zbi { .. zbi ( None , None , component_id_index :: Index :: default ( ) ) } ) ? ; model . set ( CoreDataDeps { deps } ) ? ; Ok ( model ) }
Creates a data model with a ZBI containing 4 component manifests and a default component id index.
Creates a data model with a ZBI containing 4 component manifests and a default component id index .