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

Method read_compatible

rust/fory-core/src/serializer/codec.rs:1124–1139  ·  view source on GitHub ↗
(
        context: &mut ReadContext,
        local_field_type: &FieldType,
        remote_field_type: &FieldType,
    )

Source from the content-addressed store, hash-verified

1122
1123 #[inline(always)]
1124 fn read_compatible(
1125 context: &mut ReadContext,
1126 local_field_type: &FieldType,
1127 remote_field_type: &FieldType,
1128 ) -> Result<Option<Option<T>>, Error> {
1129 if field_types_compatible(local_field_type, remote_field_type)
1130 || local_field_type.compatible_shape_match(remote_field_type)
1131 {
1132 return Self::read_field_with_type(context, remote_field_type).map(Some);
1133 }
1134 super::scalar_conversion::read_scalar_option_field::<T>(
1135 context,
1136 local_field_type,
1137 remote_field_type,
1138 )
1139 }
1140
1141 #[inline(always)]
1142 fn write_with_mode(

Callers

nothing calls this directly

Calls 5

is_emptyMethod · 0.80
field_types_compatibleFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected