[][src]Enum odbc_avro::AvroValue

pub enum AvroValue {
    Null,
    Boolean(bool),
    Int(i32),
    Long(i64),
    Float(f32),
    Double(f64),
    Bytes(Vec<u8>),
    String(String),
    Fixed(usizeVec<u8>),
    Enum(i32String),
    Union(Box<Value>),
    Array(Vec<Value>),
    Map(HashMap<String, Value, RandomState>),
    Record(Vec<(String, Value)>),
}

Represents any valid Avro value More information about Avro values can be found in the Avro Specification

Variants

Null

A null Avro value.

Boolean(bool)

A boolean Avro value.

Int(i32)

A int Avro value.

Long(i64)

A long Avro value.

Float(f32)

A float Avro value.

Double(f64)

A double Avro value.

Bytes(Vec<u8>)

A bytes Avro value.

String(String)

A string Avro value.

Fixed(usizeVec<u8>)

A fixed Avro value. The size of the fixed value is represented as a usize.

Enum(i32String)

An enum Avro value.

An Enum is represented by a symbol and its position in the symbols list of its corresponding schema. This allows schema-less encoding, as well as schema resolution while reading values.

Union(Box<Value>)

An union Avro value.

Array(Vec<Value>)

An array Avro value.

A map Avro value.

Record(Vec<(String, Value)>)

A record Avro value.

A Record is represented by a vector of (<record name>, value). This allows schema-less encoding.

See Record for a more user-friendly support.

Methods

impl Value[src]

pub fn validate(&self, schema: &Schema) -> bool[src]

Validate the value against the given Schema.

See the Avro specification for the full set of rules of schema validation.

pub fn resolve(self, schema: &Schema) -> Result<Value, Error>[src]

Attempt to perform schema resolution on the value, with the given Schema.

See Schema Resolution in the Avro specification for the full set of rules of schema resolution.

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl PartialEq<Value> for Value[src]

impl StructuralPartialEq for Value[src]

impl ToAvro for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

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> Same<T> for T

type Output = T

Should always be Self

impl<T> ToErrorNoContext<T> for T

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.

impl<E, C> WrapContext<C> for E

type ContextError = ErrorContext<E, C>