[][src]Enum avrow::Value

pub enum Value {
    Null,
    Int(i32),
    Long(i64),
    Boolean(bool),
    Float(f32),
    Double(f64),
    Record(Record),
    Fixed(Vec<u8>),
    Map(HashMap<String, Value>),
    Bytes(Vec<u8>),
    Str(String),
    Union(Box<Value>),
    Enum(String),
    Array(Vec<Value>),
    Byte(u8),
}

Represents an Avro value

Variants

Null

A null value.

Int(i32)

An i32 integer value.

Long(i64)

An i64 long value.

Boolean(bool)

A boolean value.

Float(f32)

A f32 float value.

Double(f64)

A f64 float value.

Record(Record)

A Record value (BTreeMap<String, Value>).

Fixed(Vec<u8>)

A Fixed value.

A Map value.

Bytes(Vec<u8>)

A sequence of u8 bytes.

Str(String)

Rust strings map directly to avro strings

Union(Box<Value>)

A union is a sequence of unique Values

Enum(String)

An enumeration. Unlike Rust enums, enums in avro don't support data within their variants.

Array(Vec<Value>)

An array of Values

Byte(u8)

auxiliary u8 helper for serde. Not an avro value.

Implementations

impl Value[src]

Value -> Rust value

pub fn as_null(&self) -> Result<(), AvrowErr>[src]

Try to retrieve an avro null

pub fn as_boolean(&self) -> Result<&bool, AvrowErr>[src]

Try to retrieve an avro boolean

pub fn as_int(&self) -> Result<&i32, AvrowErr>[src]

Try to retrieve an avro int

pub fn as_long(&self) -> Result<&i64, AvrowErr>[src]

Try to retrieve an avro long

pub fn as_float(&self) -> Result<&f32, AvrowErr>[src]

Try to retrieve an avro float

pub fn as_double(&self) -> Result<&f64, AvrowErr>[src]

Try to retrieve an avro double

pub fn as_bytes(&self) -> Result<&[u8], AvrowErr>[src]

Try to retrieve an avro bytes

pub fn as_string(&self) -> Result<&str, AvrowErr>[src]

Try to retrieve an avro string

pub fn as_record(&self) -> Result<&Record, AvrowErr>[src]

Try to retrieve an avro record

pub fn as_enum(&self) -> Result<&str, AvrowErr>[src]

Try to retrieve the variant of the enum as a string

pub fn as_array(&self) -> Result<&[Value], AvrowErr>[src]

Try to retrieve an avro array

pub fn as_map(&self) -> Result<&HashMap<String, Value>, AvrowErr>[src]

Try to retrieve an avro map

pub fn as_union(&self) -> Result<&Value, AvrowErr>[src]

Try to retrieve an avro union

pub fn as_fixed(&self) -> Result<&[u8], AvrowErr>[src]

Try to retrieve an avro fixed

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

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

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

impl From<()> for Value[src]

From impls for Value

impl<T: Into<Value>> From<HashMap<String, T, RandomState>> for Value[src]

impl From<String> for Value[src]

impl<T: Into<Value>> From<Vec<T>> for Value[src]

impl From<Vec<u8>> 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<isize> for Value[src]

impl From<u64> for Value[src]

impl From<usize> for Value[src]

impl PartialEq<Value> for Value[src]

impl Serialize for Value[src]

impl StructuralPartialEq for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

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