Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion avro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,18 @@ writer.append_ser(test).unwrap();
let encoded = writer.into_inner();
```

#### Importance of the fields' order

*Important*: The order of the fields in the struct must match the order of the fields in the Avro schema!

#### Simple types

The vast majority of the times, schemas tend to define a record as a top-level container
encapsulating all the values to convert as fields and providing documentation for them, but in
case we want to directly define an Avro value, any type implementing `Serialize` should work.

```rust
let mut value = "foo".to_string();
let value = "foo".to_string();
```

### Using codecs to compress data
Expand Down
8 changes: 7 additions & 1 deletion avro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,18 @@
//! let encoded = writer.into_inner();
//! ```
//!
//! ### Importance of the fields' order
//!
//! *Important*: The order of the fields in the struct must match the order of the fields in the Avro schema!
//!
//! ### Simple types
//!
//! The vast majority of the times, schemas tend to define a record as a top-level container
//! encapsulating all the values to convert as fields and providing documentation for them, but in
//! case we want to directly define an Avro value, any type implementing `Serialize` should work.
//!
//! ```
//! let mut value = "foo".to_string();
//! let value = "foo".to_string();
//! ```
//!
//! ## Using codecs to compress data
Expand Down