MCPcopy Create free account
hub / github.com/apache/fory / source_fields

Function source_fields

rust/fory-derive/src/util.rs:76–79  ·  view source on GitHub ↗

Returns source fields with their original indices preserved. For named structs, fields are sorted by type for optimal serialization. For tuple structs, fields keep their original order. The original index is preserved so that: - For named structs: field names can be used directly - For tuple structs: the original index (0, 1, 2, ...) is used as field name

(fields: &Fields)

Source from the content-addressed store, hash-verified

74/// - For named structs: field names can be used directly
75/// - For tuple structs: the original index (0, 1, 2, ...) is used as field name
76pub fn source_fields(fields: &Fields) -> Vec<SourceField<'_>> {
77 let fields: Vec<&Field> = fields.iter().collect();
78 get_source_fields(&fields)
79}
80
81/// Returns source fields with their original indices and field names preserved.
82pub fn get_source_fields<'a>(fields: &[&'a Field]) -> Vec<SourceField<'a>> {

Calls 1

get_source_fieldsFunction · 0.85

Tested by

no test coverage detected