(
&'d mut self,
buf: &mut AvroCursor<'_>,
resolution: &'d ResolutionPlan,
)
| 1434 | } |
| 1435 | |
| 1436 | fn decode_with_resolution<'d>( |
| 1437 | &'d mut self, |
| 1438 | buf: &mut AvroCursor<'_>, |
| 1439 | resolution: &'d ResolutionPlan, |
| 1440 | ) -> Result<(), AvroError> { |
| 1441 | #[cfg(feature = "avro_custom_types")] |
| 1442 | if let Self::RunEndEncoded(_, len, inner) = self { |
| 1443 | *len += 1; |
| 1444 | return inner.decode_with_resolution(buf, resolution); |
| 1445 | } |
| 1446 | |
| 1447 | match resolution { |
| 1448 | ResolutionPlan::Promotion(promotion) => { |
| 1449 | let promotion = *promotion; |
| 1450 | self.decode_with_promotion(buf, promotion) |
| 1451 | } |
| 1452 | ResolutionPlan::DefaultValue(lit) => self.append_default(lit), |
| 1453 | ResolutionPlan::EnumMapping(res) => { |
| 1454 | let Self::Enum(indices, _, _) = self else { |
| 1455 | return Err(AvroError::SchemaError( |
| 1456 | "enum mapping resolution provided for non-enum decoder".into(), |
| 1457 | )); |
| 1458 | }; |
| 1459 | let raw = buf.get_int()?; |
| 1460 | let resolved = res.resolve(raw)?; |
| 1461 | indices.push(resolved); |
| 1462 | Ok(()) |
| 1463 | } |
| 1464 | ResolutionPlan::Record(proj) => { |
| 1465 | let Self::Record(_, encodings, _, _) = self else { |
| 1466 | return Err(AvroError::SchemaError( |
| 1467 | "record projection provided for non-record decoder".into(), |
| 1468 | )); |
| 1469 | }; |
| 1470 | proj.project_record(buf, encodings) |
| 1471 | } |
| 1472 | } |
| 1473 | } |
| 1474 | |
| 1475 | /// Flush decoded records to an [`ArrayRef`] |
| 1476 | fn flush(&mut self, nulls: Option<NullBuffer>) -> Result<ArrayRef, AvroError> { |
no test coverage detected