Constructs an `avro::Value` if this is of underlying long type. Guaranteed to be `Some` when `is_underlying_long` is `true`.
(&self, long: i64)
| 339 | /// Constructs an `avro::Value` if this is of underlying long type. |
| 340 | /// Guaranteed to be `Some` when `is_underlying_long` is `true`. |
| 341 | pub fn try_make_long_value(&self, long: i64) -> Option<Result<AvroValue, AvroError>> { |
| 342 | match self { |
| 343 | SchemaPiece::Long => Some(Ok(AvroValue::Long(long))), |
| 344 | SchemaPiece::TimestampMilli => Some(build_ts_value(long, TsUnit::Millis)), |
| 345 | SchemaPiece::TimestampMicro => Some(build_ts_value(long, TsUnit::Micros)), |
| 346 | _ => None, |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | /// Represents any valid Avro schema |
no test coverage detected