Google is committed to advancing racial equity for Black communities. See how.

Generated code output guide

This document outlines the approaches available for viewing generated FIDL bindings code. For general information about how FIDL definitions get converted to target language code, refer to the bindings reference.

Viewing generated code

If you would like to look at the generated output for a specific target in the Fuchsia build, you can first build the target in question, then inspect the generated files in the build output. The instructions in this section assume that the target is defined using the standard fidl GN template, and that the out directory is at the default path (out/default).

GN build

The root of the FIDL output in the GN build for a library fuchsia.examples defined in directory sdk/fidl is:



The C family bindings are further generated into a fuchsia/examples subdirectory, which comes from the library name. From there:

  • HLCPP outputs cpp/, cpp/fidl.h, and cpp/fidl_test_base.h.
  • LLCPP outputs llcpp/ and llcpp/fidl.h.
  • C outputs c/fidl.client.c, c/fidl.server.c, and fidl.h.

For example, using with the HLCPP bindings creates the following files:


and using with the LLCPP bindings creates the following files:



The Rust bindings output is contained in a single file in the root directory. For example, is generated to the following file:



Go bindings are generated into an impl.go file located in a subdirectory in the root directory. For example, building generates the following file:



The JSON IR is generated to the root directory:



The FIDL package for a library named fuchsia.examples, defined in the directory sdk/fuchsia.examples is:


The first instance of fuchsia.examples comes from the path, whereas the second comes from the library name, so the general pattern would be:

out/default/dartlang/gen/[path to FIDL library]/[FIDL library name]_package

Within the package, lib/fidl_async.dart contains the bindings code. lib/fidl_test.dart contains utilities for testing.

Using fidlbolt

For ad hoc examples or existing FIDL files, another option is to use the fidlbolt tool. By pasting the desired FIDL content into fidlbolt, it is possible to view the output for each binding, as well as for the JSON IR. fidlbolt also supports importing libraries defined in the sdk, so that the FIDL code can use e.g. using; to refer to IDK libraries.

Viewing generated documentation


It is possible to generate documentation for generated Rust bindings using fx rustdoc.