Because of the Rust migration, some of these Rust structs have bool fields set as u8 to be compatible with C representation of boolean with FFI. This can also happen pretty often in Cython <-> Rust conversion that is being done in Postgres adapter.
This poses some problems in deserialization from dicts or strings to these native Rust types. One way to handle this discrepancy is to create a custom deserializer that will convert bools to u8
We also have to take into account that we can receive bool and normal integer
created BoolVisitor which will be used as a deserializer with serdeattribute deserialize_with on most of the reconciliationu8 fields
Pull Request
Because of the Rust migration, some of these Rust structs have bool fields set as
u8
to be compatible with C representation of boolean with FFI. This can also happen pretty often in Cython <-> Rust conversion that is being done in Postgres adapter. This poses some problems in deserialization from dicts or strings to these native Rust types. One way to handle this discrepancy is to create a custom deserializer that will convert bools tou8
We also have to take into account that we can receive bool and normal integerBoolVisitor
which will be used as a deserializer withserde
attributedeserialize_with
on most of thereconciliation
u8
fields