Struct avro_rs::types::Record
[−]
[src]
pub struct Record { pub fields: Vec<(String, Value)>, // some fields omitted }
Utility interface to build Value::Record
objects.
Fields
fields: Vec<(String, Value)>
List of fields contained in the record.
Ordered according to the fields in the schema given to create this
Record
object. Any unset field defaults to Value::Null
.
Methods
impl Record
[src]
pub fn new(schema: &Schema) -> Option<Record>
[src]
Create a Record
given a Schema
.
If the Schema
is not a Schema::Record
variant, None
will be returned.
pub fn put<V>(&mut self, field: &str, value: V) where
V: ToAvro,
[src]
V: ToAvro,
Put a compatible value (implementing the ToAvro
trait) in the
Record
for a given field
name.
NOTE Only ensure that the field name is present in the Schema
given when creating
this Record
. Does not perform any schema validation.
Trait Implementations
impl Debug for Record
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Record
[src]
fn clone(&self) -> Record
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more