> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# bool_as_int

> bool_as_int — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[avro\_schema\_builder](https://docs.kinetica.com/content/api/rust/avro_schema_builder/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/avro_schema_builder.rs#L87)&#x20;

Writes a `bool` as the Avro int a Kinetica boolean column holds, 1 or 0, and reads any int other than 0 as `true`. For a field declared with [`AvroSchemaBuilder::bool_field`](https://docs.kinetica.com/content/api/rust/avro_schema_builder/struct.AvroSchemaBuilder#method.bool_field):

```rust theme={null}
#[serde(with = "gpudb_api::avro_schema_builder::bool_as_int")]
is_valid: bool,
```

## Functions

[deserialize](https://docs.kinetica.com/content/api/rust/avro_schema_builder/bool_as_int/fn.deserialize.md)Reads an int, `true` unless 0.[serialize](https://docs.kinetica.com/content/api/rust/avro_schema_builder/bool_as_int/fn.serialize.md)Writes `true` as 1 and `false` as 0.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.