You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: runtime_command.rs
    path of file: ./repos/zenoh-flow/zfctl/src
    
    the code of the file until where you have to start completion: //
// Copyright (c) 2021 - 2024 ZettaScale Technology
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
//
// Contributors:
//   ZettaScale Zenoh Team, <zenoh@zettascale.tech>
//

use super::row;

use std::time::Duration;

use anyhow::{anyhow, bail};
use clap::Subcommand;
use comfy_table::{Row, Table};
use zenoh::prelude::r#async::*;
use zenoh_flow_commons::{Result, RuntimeId};
use zenoh_flow_daemon::{
    runtime::{RuntimeInfo, RuntimeStatus, RuntimesQuery},
    selecto
    
pub(crate) async fn get_all_runtimes(session: &Session) -> Result<Vec<RuntimeInfo>> {
    let value = serde_json::to_vec(&RuntimesQuery::List).map_err(|e| {
        tracing::error!(
            "`serde_json` failed to serialize `RuntimeQuery::List`: {:?}",
            e
        );
        anyhow!(ZENOH_FLOW_INTERNAL_ERROR)
    })?;

    let runtime_replies = session
        .get(zenoh_flow_daemon::selectors::selector_all_runtimes().unwrap())
        .with_value(value)
        // We want to address all the Zenoh-Flow runtimes that are reachable on the Zenoh network.
        .consolidation(ConsolidationMode::None)
        // .target(QueryTarget::All)
        .res()
        .await
        .map_err(|e| anyhow!("Failed to query available runtimes:\n{:?}", e))?;

    let mut runtimes = Vec::new();
    while let Ok(reply) = runtime_replies.recv_async().await {
        match reply.sample {
            Ok(sample) => {
                match serde_json::from_slice::<RuntimeInfo>(&sample.value.payload.contiguous()) {
                    Ok(runtime_info) => runtimes.push(runtime_info),
                    Err(e) => {
                        tracing::error!("Failed to parse a reply as a `RuntimeId`:\n{:?}", e)
                    }
                }
            }

            Err(e) => tracing::warn!("A reply returned an error:\n{:?}", e),
        }
    }

    if runtimes.is_empty() {
        tracing::error!("No Zenoh-Flow runtime were detected. Have you checked if (i) they are up and (ii) reachable through Zenoh?");
        bail!("zfctl encountered a fatal error, aborting.");
    }

    Ok(runtimes)
}