[−][src]Struct avrow::Schema
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,