File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
internal/rust/templates/common Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ limitations under the License.
1919{ {{.} }}
2020{ {/Codec.DocLines} }
2121{ {> /templates/common/feature_gate} }
22- #[derive(Clone, Debug, Default, PartialEq)]
22+ #[derive(Clone, Default, PartialEq)]
2323#[non_exhaustive]
2424{ {#Deprecated} }
2525#[deprecated]
@@ -338,6 +338,24 @@ impl serde::ser::Serialize for {{Codec.Name}} {
338338 state.end()
339339 }
340340}
341+
342+ { {> /templates/common/feature_gate} }
343+ impl std::fmt::Debug for { {Codec.Name} } {
344+ fn fmt(&self, f: &mut std::fmt::Formatter< ' _>) -> std::fmt::Result {
345+ let mut debug_struct = f.debug_struct("{{Codec.Name}}");
346+ {{#Codec.BasicFields}}
347+ debug_struct.field("{{Codec.FieldName}}", &self.{{Codec.FieldName}});
348+ {{/Codec.BasicFields}}
349+ {{#OneOfs}}
350+ debug_struct.field("{{Codec.FieldName}}", &self.{{Codec.FieldName}});
351+ {{/OneOfs}}
352+
353+ if !self._unknown_fields.is_empty() {
354+ debug_struct.field("_unknown_fields", &self._unknown_fields);
355+ }
356+ debug_struct.finish()
357+ }
358+ }
341359{{#Codec.HasNestedTypes}}
342360
343361/// Defines additional types related to [{{Name}}].
You can’t perform that action at this time.
0 commit comments