Type Alias zino_core::Record

source ·
pub type Record = Vec<(String, AvroValue)>;
Expand description

A schema-less Avro record value.

Aliased Type§

struct Record { /* private fields */ }

Trait Implementations§

source§

impl AvroRecordExt for Record

source§

fn get_bool(&self, key: &str) -> Option<bool>

Extracts the boolean value corresponding to the key.
source§

fn get_i32(&self, key: &str) -> Option<i32>

Extracts the integer value corresponding to the key.
source§

fn get_i64(&self, key: &str) -> Option<i64>

Extracts the Long integer value corresponding to the key.
source§

fn get_u16(&self, key: &str) -> Option<u16>

Extracts the integer value corresponding to the key and represents it as u16 if possible.
source§

fn get_u32(&self, key: &str) -> Option<u32>

Extracts the integer value corresponding to the key and represents it as u32 if possible.
source§

fn get_u64(&self, key: &str) -> Option<u64>

Extracts the integer value corresponding to the key and represents it as u64 if possible.
source§

fn get_usize(&self, key: &str) -> Option<usize>

Extracts the integer value corresponding to the key and represents it as usize if possible.
source§

fn get_f32(&self, key: &str) -> Option<f32>

Extracts the float value corresponding to the key.
source§

fn get_f64(&self, key: &str) -> Option<f64>

Extracts the float value corresponding to the key.
source§

fn get_bytes(&self, key: &str) -> Option<&[u8]>

Extracts the bytes corresponding to the key.
source§

fn get_str(&self, key: &str) -> Option<&str>

Extracts the string corresponding to the key.
source§

fn contains_key(&self, key: &str) -> bool

Returns true if the record contains a value for the key.
source§

fn find(&self, key: &str) -> Option<&AvroValue>

Searches for the key and returns its value.
source§

fn position(&self, key: &str) -> Option<usize>

Searches for the key and returns its index.
source§

fn upsert( &mut self, key: impl Into<String>, value: impl Into<AvroValue> ) -> Option<AvroValue>

Inserts or updates a pair into the record. If the record did have this key, the value is updated and the old value is returned, otherwise None is returned.
source§

fn flush_to_writer<W: Write>( self, schema: &Schema, writer: W ) -> Result<usize, Error>

Flushes the content appended to a writer with the given schema. Returns the number of bytes written.
source§

fn into_avro_map(self) -> HashMap<String, AvroValue>

Converts self to an Avro map.
source§

fn try_into_map(self) -> Result<Map, Error>

Consumes self and attempts to construct a json object.
source§

fn from_entry(key: impl Into<String>, value: impl Into<AvroValue>) -> Self

Creates a new instance with the entry.
source§

impl DecodeRow<SqliteRow> for Record

Available on crate features orm and orm-sqlx only.
§

type Error = Error

The error type.
source§

fn decode_row(row: &DatabaseRow) -> Result<Self, Self::Error>

Decodes a row and attempts to create an instance of Self.