Skip to main content

infer_type

Function infer_type 

Source
pub fn infer_type(value: &ParseValue) -> Option<FieldType>
Expand description

Infer a field type from a value, as getType does.

None means “no type”, not “unknown”. A literal null yields undefined upstream, and the write path skips the field rather than creating it, which is why writing null to a new field never adds a column. Returning Option here keeps that distinction at the type level instead of leaving it to a caller to remember.

A tagged value with its required member missing also yields None: upstream’s switch breaks out of the case and falls through to returning undefined, so {"__type":"Pointer"} with no className is not a Pointer and not an error at this stage.