Skip to main content

driver_tools/subcommands/composite/
mod.rs

1// Copyright 2026 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5pub mod args;
6pub mod subcommands;
7
8use anyhow::{Context, Result};
9use args::{CompositeCommand, CompositeSubcommand};
10use fidl_fuchsia_driver_development as fdd;
11use std::io::Write;
12
13pub async fn composite(
14    cmd: CompositeCommand,
15    writer: &mut dyn Write,
16    driver_development_proxy: fdd::ManagerProxy,
17) -> Result<()> {
18    match cmd.subcommand {
19        CompositeSubcommand::List(subcmd) => {
20            subcommands::list::list(subcmd, writer, driver_development_proxy)
21                .await
22                .context("List composite subcommand failed")?;
23        }
24        CompositeSubcommand::Show(subcmd) => {
25            subcommands::show::show(subcmd, writer, driver_development_proxy)
26                .await
27                .context("Show composite subcommand failed")?;
28        }
29    }
30    Ok(())
31}