[][src]Struct avrow::Record

pub struct Record { /* fields omitted */ }

The record avro type

Implementations

impl Record[src]

pub fn new(name: &str) -> Self[src]

Creates a new avro record type with the given name.

pub fn insert<T: Into<Value>>(
    &mut self,
    field_name: &str,
    ty: T
) -> Result<(), AvrowErr>
[src]

Adds a field to the record.

pub fn set_field_order(
    &mut self,
    field_name: &str,
    order: Order
) -> Result<(), AvrowErr>
[src]

Sets the ordering of the field.

pub fn from_btree<K: Into<String> + Ord + Display, V: Into<Value>>(
    name: &str,
    btree: BTreeMap<K, V>
) -> Result<Self, AvrowErr>
[src]

Creates a record from a BTreeMap by consuming it. The values in btree must implement Into. The name provided must match with the name in the record schema being provided to the writer.

pub fn from_json(
    json: Map<String, Value>,
    schema: &Schema
) -> Result<Value, AvrowErr>
[src]

Creates a record from a json object. A confirming record schema must be provided.

Trait Implementations

impl Clone for Record[src]

impl Debug for Record[src]

impl PartialEq<Record> for Record[src]

impl Serialize for Record[src]

impl StructuralPartialEq for Record[src]

Auto Trait Implementations

impl RefUnwindSafe for Record

impl Send for Record

impl Sync for Record

impl Unpin for Record

impl UnwindSafe for Record

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.