pub async fn add_cml_element(
    child_name: &str,
    child_url: &str,
    child_collection: &str,
    realm: &fsys::RealmProxy,
) -> Result<(), ElementManagerError> {
    realm_management::create_child_component(&child_name, &child_url, child_collection, &realm)
        .await
        .map_err(|err: fsys::Error| {
            ElementManagerError::not_created(child_name, child_collection, child_url, err)
        })?;

    realm_management::bind_child_component(child_name, child_collection, &realm).await.map_err(
        |err: fsys::Error| {
            ElementManagerError::not_bound(child_name, child_collection, child_url, err)
        },
    )?;
    Ok(())
}
/// Adds a v2 component element to the session.
///
/// #Parameters
/// - `child_name`: The name of the element, must be unique within a session. The name must be
///                 non-empty, of the form [a-z0-9-_.].
/// - `child_url`: The component url of the child added to the session.
/// - `child_collection`: The collection to add the element in, must match a collection in the
///                       calling component's CML file.
/// - `realm`: The `Realm` to which the child will be added.
Adds a v2 component element to the session.
Adds a v2 component element to the session .
pub async fn add_cml_element(
    child_name: &str,
    child_url: &str,
    child_collection: &str,
    realm: &fsys::RealmProxy,
) -> Result<(), ElementManagerError> {
    realm_management::create_child_component(&child_name, &child_url, child_collection, &realm)
        .await
        .map_err(|err: fsys::Error| {
            ElementManagerError::not_created(child_name, child_collection, child_url, err)
        })?;
    realm_management::bind_child_component(child_name, child_collection, &realm).await.map_err(
        |err: fsys::Error| {
            ElementManagerError::not_bound(child_name, child_collection, child_url, err)
        },
    )?;
    Ok(())
}
pub async fn add_cml_element ( child_name : & str , child_url : & str , child_collection : & str , realm : & fsys :: RealmProxy , ) -> Result < ( ) , ElementManagerError > { realm_management :: create_child_component ( & child_name , & child_url , child_collection , & realm ) . await . map_err ( | err : fsys :: Error | { ElementManagerError :: not_created ( child_name , child_collection , child_url , err ) } ) ? ; realm_management :: bind_child_component ( child_name , child_collection , & realm ) . await . map_err ( | err : fsys :: Error | { ElementManagerError :: not_bound ( child_name , child_collection , child_url , err ) } , ) ? ; Ok ( ( ) ) }
Adds a v2 component element to the session.
Adds a v2 component element to the session .
child_name
&str
The name of the element, must be unique within a session. The name must be
non-empty, of the form [a-z0-9-_.].
The name of the element must be unique within a session . The name must be non - empty of the form [ a - z0 - 9 - _ . ] .
child_url
&str
The component url of the child added to the session.
The component url of the child added to the session .
child_collection
&str
The collection to add the element in, must match a collection in the
calling component's CML file.
The collection to add the element in must match a collection in the calling component ' s CML file .
realm
&fsys::RealmProxy
The `Realm` to which the child will be added.
The ` Realm ` to which the child will be added .