MCPcopy Create free account
hub / github.com/apache/arrow-rs / encode

Method encode

arrow-avro/src/writer/encoder.rs:746–760  ·  view source on GitHub ↗
(&mut self, out: &mut W, idx: usize)

Source from the content-addressed store, hash-verified

744 }
745
746 fn encode<W: Write + ?Sized>(&mut self, out: &mut W, idx: usize) -> Result<(), AvroError> {
747 match &self.null_state {
748 NullState::NonNullable => {}
749 NullState::NullableNoNulls { union_value_byte } => out
750 .write_all(&[*union_value_byte])
751 .map_err(|e| AvroError::IoError(format!("write union value branch: {e}"), e))?,
752 NullState::Nullable { nulls, null_order } if nulls.is_null(idx) => {
753 return write_optional_index(out, true, *null_order); // no value to write
754 }
755 NullState::Nullable { null_order, .. } => {
756 write_optional_index(out, false, *null_order)?;
757 }
758 }
759 self.encoder.encode(out, idx)
760 }
761}
762
763fn union_value_branch_byte(null_order: Nullability, is_null: bool) -> u8 {

Calls 15

write_optional_indexFunction · 0.85
write_boolFunction · 0.85
write_intFunction · 0.85
write_longFunction · 0.85
write_len_prefixedFunction · 0.85
encode_blocked_rangeFunction · 0.85
from_sliceFunction · 0.85
write_sign_extendedFunction · 0.85
minimal_twos_complementFunction · 0.85
prepare_for_batchMethod · 0.80
type_idsMethod · 0.80
and_thenMethod · 0.80