[][src]Struct avrow::Schema

pub struct Schema { /* fields omitted */ }

Represents the avro schema used to write encoded avro data

Implementations

impl Schema[src]

pub fn from_path<P: AsRef<Path> + Debug>(path: P) -> Result<Self, AvrowErr>[src]

Parses an avro schema from a json description of schema in a file. Alternatively, one can use the FromStr impl to create a Schema from a JSON string:

use std::str::FromStr;
use avrow::Schema;

let schema = Schema::from_str(r##""null""##).unwrap();

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

Returns the canonical form of an Avro schema

use avrow::Schema;
use std::str::FromStr;

let schema = Schema::from_str(r##"
    {
        "type": "record",
        "name": "LongList",
        "aliases": ["LinkedLongs"],
        "fields" : [
            {"name": "value", "type": "long"},
            {"name": "next", "type": ["null", "LongList"]
        }]
    }
"##).unwrap();
let canonical = schema.canonical_form();

Trait Implementations

impl Debug for Schema[src]

impl FromStr for Schema[src]

type Err = AvrowErr

The associated error which can be returned from parsing.

fn from_str(schema: &str) -> Result<Self, Self::Err>[src]

Parse an avro schema from a json string One can use Rust's raw string syntax (r##""##) to pass schema.

impl PartialEq<Schema> 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, 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.