# Plexor Codec: Serde Postcard
**plexor-codec-serde-postcard** provides a Postcard codec implementation for the [Plexor](https://gitlab.com/plexo/plexor) distributed system architecture.
It enables `Neurons` to serialize and deserialize payloads using the efficient, no-std compatible `postcard` library, making it ideal for compact binary messaging and embedded environments.
## Features
- **Seamless Integration**: Implements the `Codec` trait for `plexor-core`.
- **High Performance**: Leverages `postcard` for extremely compact and fast binary serialization.
- **Type Safety**: Leverages Rust's strong typing via `serde::Serialize` and `serde::Deserialize`.
- **Flexibility**: Works with any type that implements Serde traits.
## Usage
### 1. Add Dependencies
```toml
[dependencies]
plexor-core = "0.1.0-alpha.1"
plexor-codec-serde-postcard = "0.1.0-alpha.1"
serde = { version = "1.0", features = ["derive"] }
```
### 2. Define a Message
```rust
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct MyMessage {
pub content: String,
pub count: u32,
}
```
### 3. Use in a Neuron
```rust
use plexor_core::neuron::NeuronImpl;
use plexor_core::namespace::NamespaceImpl;
use plexor_codec_serde_postcard::SerdePostcardCodec;
use std::sync::Arc;
// Define the Neuron using the Postcard codec
let neuron = NeuronImpl::<MyMessage, SerdePostcardCodec>::new_arc(
Arc::new(NamespaceImpl {
delimiter: ".",
parts: vec!["my", "message"],
})
);
```
## License
Mozilla Public License, version 2.0.