pub fn to_json(&self) -> Value {
        let children: Vec<Value> = match self.data_type() {
            DataType::Struct(fields) => fields.iter().map(|f| f.to_json()).collect(),
            DataType::List(dtype) => {
                let item = Field::new("item", *dtype.clone(), self.nullable);
                vec![item.to_json()]
            }
            DataType::FixedSizeList(dtype, _) => {
                let item = Field::new("item", *dtype.clone(), self.nullable);
                vec![item.to_json()]
            }
            _ => vec![],
        };
        match self.data_type() {
            DataType::Dictionary(ref index_type, ref value_type) => json!({
                "name": self.name,
                "nullable": self.nullable,
                "type": value_type.to_json(),
                "children": children,
                "dictionary": {
                    "id": self.dict_id,
                    "indexType": index_type.to_json(),
                    "isOrdered": self.dict_is_ordered
                }
            }),
            _ => json!({
                "name": self.name,
                "nullable": self.nullable,
                "type": self.data_type.to_json(),
                "children": children
            }),
        }
    }
/// Generate a JSON representation of the `Field`
Generate a JSON representation of the `Field`
Generate a JSON representation of the ` Field `
pub fn to_json(&self) -> Value {
        let children: Vec<Value> = match self.data_type() {
            DataType::Struct(fields) => fields.iter().map(|f| f.to_json()).collect(),
            DataType::List(dtype) => {
                let item = Field::new("item", *dtype.clone(), self.nullable);
                vec![item.to_json()]
            }
            DataType::FixedSizeList(dtype, _) => {
                let item = Field::new("item", *dtype.clone(), self.nullable);
                vec![item.to_json()]
            }
            _ => vec![],
        };
        match self.data_type() {
            DataType::Dictionary(ref index_type, ref value_type) => json!({
                "name": self.name,
                "nullable": self.nullable,
                "type": value_type.to_json(),
                "children": children,
                "dictionary": {
                    "id": self.dict_id,
                    "indexType": index_type.to_json(),
                    "isOrdered": self.dict_is_ordered
                }
            }),
            _ => json!({
                "name": self.name,
                "nullable": self.nullable,
                "type": self.data_type.to_json(),
                "children": children
            }),
        }
    }
pub fn to_json ( & self ) -> Value { let children : Vec < Value > = match self . data_type ( ) { DataType :: Struct ( fields ) => fields . iter ( ) . map ( | f | f . to_json ( ) ) . collect ( ) , DataType :: List ( dtype ) => { let item = Field :: new ( " " , * dtype . clone ( ) , self . nullable ) ; vec ! [ item to_json ( ) ] } DataType :: FixedSizeList ( dtype , _ ) => { let item = Field :: new ( " " , * dtype . clone ( ) , self . nullable ) ; vec ! [ item to_json ( ) ] } _ => vec ! [ ] , } ; match self . data_type ( ) { DataType :: Dictionary ( ref index_type , ref value_type ) => json ! ( { " " self name " " self nullable " " value_type to_json ( ) " " children " " { " " self dict_id " " index_type to_json ( ) " " self dict_is_ordered } } ) , _ => json ! ( { " " self name " " self nullable " " self data_type to_json ( ) " " children } ) , } }
Generate a JSON representation of the `Field`
Generate a JSON representation of the ` Field `
&self
&self