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

Function write_tuple_element

rust/fory-core/src/serializer/tuple.rs:90–104  ·  view source on GitHub ↗
(elem: &T, context: &mut WriteContext)

Source from the content-addressed store, hash-verified

88/// This handles the different serialization strategies for various element types.
89#[inline(always)]
90fn write_tuple_element<T: Serializer>(elem: &T, context: &mut WriteContext) -> Result<(), Error> {
91 if T::fory_is_option() || T::fory_is_shared_ref() || T::fory_static_type_id() == TypeId::UNKNOWN
92 {
93 // For Option, shared references, or unknown static types, use full write with ref tracking
94 let ref_mode = if T::fory_is_shared_ref() {
95 RefMode::Tracking
96 } else {
97 RefMode::NullOnly
98 };
99 elem.fory_write(context, ref_mode, false, false)
100 } else {
101 // For concrete types with known static type IDs, directly write data
102 elem.fory_write_data(context)
103 }
104}
105
106/// Helper function to read a tuple element based on its type characteristics.
107#[inline(always)]

Callers 1

fory_write_dataMethod · 0.85

Calls 2

fory_writeMethod · 0.45
fory_write_dataMethod · 0.45

Tested by

no test coverage detected