xref: /aosp_15_r20/external/bazel-skylib/docs/structs_doc.md (revision bcb5dc7965af6ee42bf2f21341a2ec00233a8c8a)
1*bcb5dc79SHONG Yifan<!-- Generated with Stardoc: http://skydoc.bazel.build -->
2*bcb5dc79SHONG Yifan
3*bcb5dc79SHONG YifanSkylib module containing functions that operate on structs.
4*bcb5dc79SHONG Yifan
5*bcb5dc79SHONG Yifan<a id="structs.to_dict"></a>
6*bcb5dc79SHONG Yifan
7*bcb5dc79SHONG Yifan## structs.to_dict
8*bcb5dc79SHONG Yifan
9*bcb5dc79SHONG Yifan<pre>
10*bcb5dc79SHONG Yifanstructs.to_dict(<a href="#structs.to_dict-s">s</a>)
11*bcb5dc79SHONG Yifan</pre>
12*bcb5dc79SHONG Yifan
13*bcb5dc79SHONG YifanConverts a `struct` to a `dict`.
14*bcb5dc79SHONG Yifan
15*bcb5dc79SHONG Yifan**PARAMETERS**
16*bcb5dc79SHONG Yifan
17*bcb5dc79SHONG Yifan
18*bcb5dc79SHONG Yifan| Name  | Description | Default Value |
19*bcb5dc79SHONG Yifan| :------------- | :------------- | :------------- |
20*bcb5dc79SHONG Yifan| <a id="structs.to_dict-s"></a>s |  A `struct`.   |  none |
21*bcb5dc79SHONG Yifan
22*bcb5dc79SHONG Yifan**RETURNS**
23*bcb5dc79SHONG Yifan
24*bcb5dc79SHONG YifanA `dict` whose keys and values are the same as the fields in `s`. The
25*bcb5dc79SHONG Yifantransformation is only applied to the struct's fields and not to any
26*bcb5dc79SHONG Yifannested values.
27*bcb5dc79SHONG Yifan
28*bcb5dc79SHONG Yifan
29