[][src]Enum avro_rs::types::Value

pub enum Value {
    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>),
    Record(Vec<(String, Value)>),
    Date(i32),
    Decimal(Decimal),
    TimeMillis(i32),
    TimeMicros(i64),
    TimestampMillis(i64),
    TimestampMicros(i64),
    Duration(Duration),
    Uuid(Uuid),
}

A 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.

Date(i32)

A date value.

Serialized and deserialized as i32 directly. Can only be deserialized properly with a schema.

Decimal(Decimal)

An Avro Decimal value. Bytes are in big-endian order, per the Avro spec.

TimeMillis(i32)

Time in milliseconds.

TimeMicros(i64)

Time in microseconds.

TimestampMillis(i64)

Timestamp in milliseconds.

TimestampMicros(i64)

Timestamp in microseconds.

Duration(Duration)

Avro Duration. An amount of time defined by months, days and milliseconds.

Uuid(Uuid)

Universally unique identifier. Universally unique identifier.

Implementations

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(mut self: Self, schema: &Schema) -> AvroResult<Self>[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 From<&'_ [u8]> for Value[src]

impl From<&'_ str> for Value[src]

impl<'_enum> From<&'_enum Value> for ValueKind[src]

impl<'a> From<&'a Value> for SchemaKind[src]

impl From<()> for Value[src]

impl From<Codec> for Value[src]

impl From<Decimal> for Value[src]

impl From<Duration> for Value[src]

impl<K, V, S> From<HashMap<K, V, S>> for Value where
    K: Into<String>,
    V: Into<Self>,
    S: BuildHasher
[src]

impl<T> From<Option<T>> for Value where
    T: Into<Self>, 
[src]

impl<'a> From<Record<'a>> for Value[src]

impl From<String> for Value[src]

impl From<Uuid> for Value[src]

impl From<Value> for ValueKind[src]

impl From<Value> for Value[src]

impl From<Vec<u8, Global>> for Value[src]

impl From<bool> for Value[src]

impl From<f32> for Value[src]

impl From<f64> for Value[src]

impl From<i32> for Value[src]

impl From<i64> for Value[src]

impl From<usize> for Value[src]

impl PartialEq<Value> for Value[src]

impl StructuralPartialEq for Value[src]

Auto Trait Implementations

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> ToAvro for T where
    T: Into<Value>, 
[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,