Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions lang/rust/avro/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ impl fmt::Display for SchemaFingerprint {
}
}

// Just an example of how it may look like
struct RecordSchema {
name: Name,
aliases: Aliases,
doc: Documentation,
fields: Vec<RecordField>,
lookup: BTreeMap<String, usize>,
attributes: BTreeMap<String, Value>,
}

// Just an example of how it may look like
struct EnumSchema {
name: Name,
aliases: Aliases,
doc: Documentation,
symbols: Vec<String>,
attributes: BTreeMap<String, Value>,
}

/// Represents any valid Avro schema
/// More information about Avro schemas can be found in the
/// [Avro Specification](https://avro.apache.org/docs/current/spec.html#schemas)
Expand Down Expand Up @@ -101,22 +120,9 @@ pub enum Schema {
///
/// The `lookup` table maps field names to their position in the `Vec`
/// of `fields`.
Record {
name: Name,
aliases: Aliases,
doc: Documentation,
fields: Vec<RecordField>,
lookup: BTreeMap<String, usize>,
attributes: BTreeMap<String, Value>,
},
Record(RecordSchema),
/// An `enum` Avro schema.
Enum {
name: Name,
aliases: Aliases,
doc: Documentation,
symbols: Vec<String>,
attributes: BTreeMap<String, Value>,
},
Enum(EnumSchema),
/// A `fixed` Avro schema.
Fixed {
name: Name,
Expand Down