[][src]Enum odbc_avro::AvroSchema

pub enum AvroSchema {
    Null,
    Boolean,
    Int,
    Long,
    Float,
    Double,
    Bytes,
    String,
    Array(Box<Schema>),
    Map(Box<Schema>),
    Union(UnionSchema),
    Record {
        name: Name,
        doc: Option<String>,
        fields: Vec<RecordField>,
        lookup: HashMap<String, usize, RandomState>,
    },
    Enum {
        name: Name,
        doc: Option<String>,
        symbols: Vec<String>,
    },
    Fixed {
        name: Name,
        size: usize,
    },
}

Represents any valid Avro schema More information about Avro schemas can be found in the Avro Specification

Variants

Null

A null Avro schema.

Boolean

A boolean Avro schema.

Int

An int Avro schema.

Long

A long Avro schema.

Float

A float Avro schema.

Double

A double Avro schema.

Bytes

A bytes Avro schema. Bytes represents a sequence of 8-bit unsigned bytes.

String

A string Avro schema. String represents a unicode character sequence.

Array(Box<Schema>)

A array Avro schema. Avro arrays are required to have the same type for each element. This variant holds the Schema for the array element type.

Map(Box<Schema>)

A map Avro schema. Map holds a pointer to the Schema of its values, which must all be the same schema. Map keys are assumed to be string.

A union Avro schema.

Record

A record Avro schema.

The lookup table maps field names to their position in the Vec of fields.

Fields of Record

name: Namedoc: Option<String>fields: Vec<RecordField>lookup: HashMap<String, usize, RandomState>
Enum

An enum Avro schema.

Fields of Enum

name: Namedoc: Option<String>symbols: Vec<String>
Fixed

A fixed Avro schema.

Fields of Fixed

name: Namesize: usize

Methods

impl Schema[src]

pub fn parse_str(input: &str) -> Result<Schema, Error>[src]

Create a Schema from a string representing a JSON Avro schema.

pub fn parse(value: &Value) -> Result<Schema, Error>[src]

Create a Schema from a serde_json::Value representing a JSON Avro schema.

pub fn canonical_form(&self) -> String[src]

Converts self into its Parsing Canonical Form.

pub fn fingerprint<D>(&self) -> SchemaFingerprint where
    D: Digest, 
[src]

Generate fingerprint of Schema's Parsing Canonical Form.

Trait Implementations

impl Clone for Schema[src]

impl Debug for Schema[src]

impl Eq for Schema[src]

impl PartialEq<Schema> for Schema[src]

fn eq(&self, other: &Schema) -> bool[src]

Assess equality of two Schema based on Parsing Canonical Form.

impl Serialize for Schema[src]

Auto Trait Implementations

impl RefUnwindSafe for Schema

impl Send for Schema

impl Sync for Schema

impl Unpin for Schema

impl UnwindSafe for Schema

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>