Enum avro_rs::schema::Schema
[−]
[src]
pub enum Schema { Null, Boolean, Int, Long, Float, Double, Bytes, String, Array(Rc<Schema>), Map(Rc<Schema>), Union(Rc<Schema>), Record { name: Name, doc: Documentation, fields: Vec<RecordField>, lookup: Rc<HashMap<String, usize>>, }, Enum { name: Name, doc: Documentation, 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(Rc<Schema>)
A array
Avro schema.
Array
holds a counted reference (Rc
) to the Schema
of its items.
Map(Rc<Schema>)
A map
Avro schema.
Map
holds a counted reference (Rc
) to the Schema
of its values.
Map
keys are assumed to be string
.
Union(Rc<Schema>)
A union
Avro schema.
Union
holds a counted reference (Rc
) to its non-null
Schema
.
NOTE Only ["null", "< type >"]
unions are currently supported.
Any other combination of Schema
s contained in a union
will be
considered invalid and errors will be reported when trying to parse
such a schema.
Record
A record
Avro schema.
The lookup
table maps field names to their position in the Vec
of fields
.
Fields of Record
name: Name | |
doc: Documentation | |
fields: Vec<RecordField> | |
lookup: Rc<HashMap<String, usize>> |
Enum
An enum
Avro schema.
Fields of Enum
name: Name | |
doc: Documentation | |
symbols: Vec<String> |
Fixed
A fixed
Avro schema.
Fields of Fixed
name: Name | |
size: usize |
Methods
impl Schema
[src]
pub fn parse_str(input: &str) -> Result<Self, Error>
[src]
Create a Schema
from a string representing a JSON Avro schema.
pub fn parse(value: &Value) -> Result<Self, Error>
[src]
Create a Schema
from a serde_json::Value
representing a JSON Avro
schema.
Trait Implementations
impl Clone for Schema
[src]
fn clone(&self) -> Schema
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Schema
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for Schema
[src]
fn eq(&self, __arg_0: &Schema) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Schema) -> bool
[src]
This method tests for !=
.