#postcard #plexo #codec #distributed

plexor-codec-serde-postcard

Postcard codec implementation for the Plexo distributed system architecture using Serde

2 releases

Uses new Rust 2024

0.1.0-alpha.2 Feb 11, 2026
0.1.0-alpha.1 Feb 8, 2026

#8 in #postcard

MPL-2.0 license

405KB
9K SLoC

Plexor Codec: Serde Postcard

plexor-codec-serde-postcard provides a Postcard codec implementation for the 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

[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

use serde::{Serialize, Deserialize};

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct MyMessage {
    pub content: String,
    pub count: u32,
}

3. Use in a Neuron

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.

Dependencies

~9–13MB
~161K SLoC