borsh-incremental-0.1.0 has been yanked.
borsh-incremental
Incremental Borsh deserialization with defaults for backward-compatible schema evolution.
Example
use ;
use BorshDeserializeIncremental;
Attributes
| Attribute | Applies To | Description |
|---|---|---|
#[incremental(error = <Path>)] |
struct | Sets the error type for TryFrom<&[u8]>. |
#[incremental(default = <Expr>)] |
field | Expression or value used if field cannot be deserialized. |
#[incremental(deser_with = <fn>)] |
field | Uses a custom function fn(&mut &[u8]) -> Result<T, E> to deserialize that field. |
Features
- Implements
TryFrom<&[u8]>for your struct - Automatically fills missing or invalid fields with defaults
- Supports per-field custom deserializers
- Ideal for forward/backward compatibility or partial account decoding