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
21 changes: 19 additions & 2 deletions source/postcard2-eio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
[package]
name = "postcard2-eio"
version = "0.1.0"
version = "0.2.0"
authors = ["James Munns <james@onevariable.com>"]
edition = "2024"
readme = "README.md"
repository = "https://github.com/jamesmunns/postcard"
description = "postcard2 extensions crate"
license = "MIT OR Apache-2.0"
categories = [
"embedded",
"no-std",
]
keywords = [
"serde",
]
documentation = "https://docs.rs/postcarde-eio/"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
postcard2 = { version = "0.1.0", path = "../postcard2", default-features = false }
postcard2 = { version = "0.2.0", path = "../postcard2", default-features = false }
serde_core = { version = "1.0.228", default-features = false }

[dependencies.embedded_io_v0_7]
Expand Down
21 changes: 19 additions & 2 deletions source/postcard2-heapless/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
[package]
name = "postcard2-heapless"
version = "0.1.0"
version = "0.2.0"
authors = ["James Munns <james@onevariable.com>"]
edition = "2024"
readme = "README.md"
repository = "https://github.com/jamesmunns/postcard"
description = "postcard2 extension crate"
license = "MIT OR Apache-2.0"
categories = [
"embedded",
"no-std",
]
keywords = [
"serde",
]
documentation = "https://docs.rs/postcard2-heapless/"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
postcard2 = { version = "0.1.0", path = "../postcard2", default-features = false }
postcard2 = { version = "0.2.0", path = "../postcard2", default-features = false }
serde_core = { version = "1.0.228", default-features = false }

[dependencies.heapless_v0_9]
Expand Down
4 changes: 2 additions & 2 deletions source/postcard2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "postcard2"
version = "0.1.0"
version = "0.2.0"
authors = ["James Munns <james@onevariable.com>"]
edition = "2021"
edition = "2024"
readme = "README.md"
repository = "https://github.com/jamesmunns/postcard"
description = "A no_std + serde compatible message library for Rust"
Expand Down
1 change: 1 addition & 0 deletions source/postcard2/src/de/deserializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use core::marker::PhantomData;

/// The deserialization error type
#[derive(Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum DeserializerError<PopErr, FinErr> {
/// A Flavor-specific error occurred while extracting data
PopError(PopErr),
Expand Down
2 changes: 1 addition & 1 deletion source/postcard2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod de;

pub mod fixint;
mod ser;
/// todo: keep public?
// todo: keep public?
pub mod varint;

pub use de::deserializer::{Deserializer, DeserializerError};
Expand Down
3 changes: 2 additions & 1 deletion source/postcard2/src/ser/serializer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use serde_core::{ser, Serialize};
use serde_core::{Serialize, ser};

use crate::ser::flavors::Flavor;
use crate::varint::*;
Expand All @@ -22,6 +22,7 @@ where

/// The serialization error type
#[derive(Debug)]
#[non_exhaustive]
pub enum SerializerError<PushErr, FinErr> {
/// A Flavor-specific error occurred while inserting data
PushError(PushErr),
Expand Down
2 changes: 2 additions & 0 deletions source/postcard2/src/varint.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Varint tools

/// Returns the maximum number of bytes required to encode T.
pub const fn varint_max<T: Sized>() -> usize {
const BITS_PER_BYTE: usize = 8;
Expand Down