pub struct AvroSchemaBuilder /* private fields */ Implementations
Creates a new schema builder with the given record name
Sets the namespace for the record
Adds a field with the given name and type
Adds a field with documentation
Adds a nullable field (shorthand for field(name, AvroType::Nullable(…)))
pub fn long_field(self, name: impl Into<String>) -> Self
Adds a long (i64) field
pub fn float_field(self, name: impl Into<String>) -> Self
Adds a float field
pub fn double_field(self, name: impl Into<String>) -> Self
Adds a double field
pub fn string_field(self, name: impl Into<String>) -> Self
Adds a string field
pub fn bool_field(self, name: impl Into<String>) -> Self
Adds a boolean field: an Avro int, as Kinetica stores a boolean (give the column the boolean property). The struct’s bool field must be written as an int, with #[serde(with = “gpudb_api::avro_schema_builder::bool_as_int”)] (see bool_as_int); unannotated, it fails to encode.
pub fn bytes_field(self, name: impl Into<String>) -> Self
Adds a bytes field
pub fn timestamp_field(self, name: impl Into<String>) -> Self
Adds a timestamp field (long type, typically milliseconds since epoch)
pub fn nullable_string_field(self, name: impl Into<String>) -> Self
Adds a nullable string field
pub fn nullable_int_field(self, name: impl Into<String>) -> Self
Adds a nullable int field
pub fn nullable_long_field(self, name: impl Into<String>) -> Self
Adds a nullable long field
pub fn nullable_double_field(self, name: impl Into<String>) -> Self
Adds a nullable double field
pub fn nullable_bytes_field(self, name: impl Into<String>) -> Self
Adds a nullable bytes field
pub fn build_static(&self) -> &‘static str
Builds the schema and leaks it to get a &‘static str
This is useful for implementing KineticaRecord::avro_schema() which requires returning &‘static str. The memory is intentionally leaked since schemas are typically created once and live for the program’s lifetime.
Trait Implementations
impl Clone for AvroSchemaBuilder
fn clone(&self) -> AvroSchemaBuilder
fn clone_from(&mut self, source: &Self)
source. Read more