pub async fn destroy_child_component(
    child_name: &str,
    collection_name: &str,
    realm: &fcomponent::RealmProxy,
) -> Result<(), fcomponent::Error> {
    let mut child_ref = fdecl::ChildRef {
        name: child_name.to_string(),
        collection: Some(collection_name.to_string()),
    };

    realm.destroy_child(&mut child_ref).await.map_err(|_| fcomponent::Error::Internal)??;

    Ok(())
}
/// Destroys a child in the specified `Realm`. This call is expects a matching call to have been
/// made to `create_child`.
///
/// # Parameters
/// - `child_name`: The name of the child to destroy.
/// - `collection_name`: The name of collection in which the child was created.
/// - `realm`: The `Realm` the child will bound in.
///
/// # Errors
/// Returns an error if the child was not destroyed in the realm.
Destroys a child in the specified `Realm`. This call is expects a matching call to have been
made to `create_child`.
Destroys a child in the specified ` Realm ` . This call is expects a matching call to have been made to ` create_child ` .
pub async fn destroy_child_component(
    child_name: &str,
    collection_name: &str,
    realm: &fcomponent::RealmProxy,
) -> Result<(), fcomponent::Error> {
    let mut child_ref = fdecl::ChildRef {
        name: child_name.to_string(),
        collection: Some(collection_name.to_string()),
    };
    realm.destroy_child(&mut child_ref).await.map_err(|_| fcomponent::Error::Internal)??;
    Ok(())
}
pub async fn destroy_child_component ( child_name : & str , collection_name : & str , realm : & fcomponent :: RealmProxy , ) -> Result < ( ) , fcomponent :: Error > { let mut child_ref = fdecl :: ChildRef { name : child_name . to_string ( ) , collection : Some ( collection_name . to_string ( ) ) , } ; realm . destroy_child ( & mut child_ref ) . await . map_err ( | _ | fcomponent :: Error :: Internal ) ? ? ; Ok ( ( ) ) }
Destroys a child in the specified `Realm`.
Destroys a child in the specified ` Realm ` .
child_name
&str
collection_name
&str
realm
&fcomponent::RealmProxy
child_name
&str
The name of the child to destroy.
The name of the child to destroy .
collection_name
&str
The name of collection in which the child was created.
The name of collection in which the child was created .
realm
&fcomponent::RealmProxy
The `Realm` the child will bound in.
The ` Realm ` the child will bound in .
errors
Returns an error if the child was not destroyed in the realm.
Returns an error if the child was not destroyed in the realm .