[][src]Struct avro_rs::Reader

pub struct Reader<'a, R> { /* fields omitted */ }

Main interface for reading Avro formatted values.

To be used as an iterator:

for value in Reader::new(input).unwrap() {
    match value {
        Ok(v) => println!("{:?}", v),
        Err(e) => println!("Error: {}", e),
    };
}

Methods

impl<'a, R: Read> Reader<'a, R>[src]

pub fn new(reader: R) -> Result<Reader<'a, R>, Error>[src]

Creates a Reader given something implementing the io::Read trait to read from. No reader Schema will be set.

NOTE The avro header is going to be read automatically upon creation of the Reader.

pub fn with_schema(
    schema: &'a Schema,
    reader: R
) -> Result<Reader<'a, R>, Error>
[src]

Creates a Reader given a reader Schema and something implementing the io::Read trait to read from.

NOTE The avro header is going to be read automatically upon creation of the Reader.

pub fn writer_schema(&self) -> &Schema[src]

Get a reference to the writer Schema.

pub fn reader_schema(&self) -> Option<&Schema>[src]

Get a reference to the optional reader Schema.

Trait Implementations

impl<'a, R: Read> Iterator for Reader<'a, R>[src]

type Item = Result<Value, Error>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a, R> RefUnwindSafe for Reader<'a, R> where
    R: RefUnwindSafe

impl<'a, R> Send for Reader<'a, R> where
    R: Send

impl<'a, R> Sync for Reader<'a, R> where
    R: Sync

impl<'a, R> Unpin for Reader<'a, R> where
    R: Unpin

impl<'a, R> UnwindSafe for Reader<'a, R> where
    R: UnwindSafe

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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Same<T> for T

type Output = T

Should always be Self

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.