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

Method read_with_mode_expr

rust/fory-derive/src/object/field_codec.rs:196–215  ·  view source on GitHub ↗
(
        &self,
        ref_mode: TokenStream,
        read_type_info: TokenStream,
    )

Source from the content-addressed store, hash-verified

194 }
195
196 pub fn read_with_mode_expr(
197 &self,
198 ref_mode: TokenStream,
199 read_type_info: TokenStream,
200 ) -> TokenStream {
201 match &self.dispatch {
202 FieldDispatch::Codec { .. } => {
203 let call = self.codec_call();
204 quote! {
205 #call::read_with_mode(context, #ref_mode, #read_type_info)?
206 }
207 }
208 FieldDispatch::Serializer { .. } => {
209 let ty = self.value_ty;
210 quote! {
211 <#ty as fory_core::Serializer>::fory_read(context, #ref_mode, #read_type_info)?
212 }
213 }
214 }
215 }
216
217 pub fn declare_compatible_var(&self) -> TokenStream {
218 let var = &self.private_ident;

Callers 2

gen_read_single_payloadFunction · 0.80

Calls 1

codec_callMethod · 0.80

Tested by

no test coverage detected