Overview

Serializer and deserializer for the SCALE encoding based on serde.

Example

```rust use serde::{Deserialize, Serialize};

[derive(Debug, Deserialize, PartialEq, Serialize)]

struct Point { x: i8, y: i8, }

let point = Point { x: 3, y: 4 }; let deserialized = serdescale::fromslice(&serdescale::tovec(&point).unwrap()).unwrap(); assert_eq!(point, deserialized); ```

Conformance

Option<bool> is serialized as a single byte according to the SCALE encoding.

Features

no_std is supported by disabling default features.

Test

Most tests live in the serde-scale-tests crate (part of the workspace) in order to avoid dependencies enabling serde features.

sh cargo test --workspace

Contribute

All contributions shall be licensed under the zlib license.

Related projects

parity-scale-codec: Reference Rust implementation