(
ty: &Type,
meta: &ForyFieldMeta,
nullable: bool,
track_ref: bool,
)
| 437 | } |
| 438 | |
| 439 | fn field_dispatch_for( |
| 440 | ty: &Type, |
| 441 | meta: &ForyFieldMeta, |
| 442 | nullable: bool, |
| 443 | track_ref: bool, |
| 444 | ) -> syn::Result<FieldDispatch> { |
| 445 | if meta.array { |
| 446 | let codec_ty = codec_type_for(ty, meta, nullable, track_ref)?; |
| 447 | return Ok(FieldDispatch::Codec { codec_ty }); |
| 448 | } |
| 449 | if meta.encoding.is_none() |
| 450 | && meta.list.is_none() |
| 451 | && !meta.array |
| 452 | && meta.map.is_none() |
| 453 | && is_container_type(ty) |
| 454 | && !is_vec_type(ty) |
| 455 | && !contains_custom_trait_object(ty) |
| 456 | && !contains_any_object(ty) |
| 457 | { |
| 458 | return Ok(FieldDispatch::Serializer { |
| 459 | field_type: field_type_expr_for(ty, nullable, track_ref)?, |
| 460 | has_generics: true, |
| 461 | }); |
| 462 | } |
| 463 | Ok(FieldDispatch::Codec { |
| 464 | codec_ty: codec_type_for(ty, meta, nullable, track_ref)?, |
| 465 | }) |
| 466 | } |
| 467 | |
| 468 | pub(crate) fn codec_type_for( |
| 469 | ty: &Type, |
no test coverage detected