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
12 changes: 9 additions & 3 deletions source/postcard-schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ package = "defmt"
version = "0.3.5"
optional = true

[dependencies.serde-big-array_v0_5]
package = "serde-big-array"
version = "0.5.1"
optional = true

[dev-dependencies.postcard]
path = "../postcard"
version = "1.0"
Expand All @@ -93,10 +98,11 @@ derive = ["postcard-derive"]

core-net = []

defmt-v0_3 = ["defmt_v0_3"]
uuid-v1_0 = ["uuid_v1_0"]
chrono-v0_4 = ["chrono_v0_4"]
defmt-v0_3 = ["defmt_v0_3"]
fixed-v1_0 = ["fixed_v1_0"]
heapless-v0_7 = ["heapless_v0_7"]
heapless-v0_8 = ["heapless_v0_8"]
nalgebra-v0_33 = ["nalgebra_v0_33"]
fixed-v1_0 = ["fixed_v1_0"]
serde-big-array-v0_5 = ["serde-big-array_v0_5"]
uuid-v1_0 = ["uuid_v1_0"]
16 changes: 10 additions & 6 deletions source/postcard-schema/src/impls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ pub mod builtins_std;
#[cfg_attr(docsrs, doc(cfg(feature = "chrono-v0_4")))]
pub mod chrono_v0_4;

#[cfg(feature = "uuid-v1_0")]
#[cfg_attr(docsrs, doc(cfg(feature = "uuid-v1_0")))]
pub mod uuid_v1_0;
#[cfg(feature = "fixed-v1_0")]
#[cfg_attr(docsrs, doc(cfg(feature = "fixed-v1_0")))]
pub mod fixed_v1_0;

#[cfg(feature = "heapless-v0_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "heapless-v0_7")))]
Expand All @@ -34,9 +34,13 @@ pub mod heapless_v0_8;
#[cfg_attr(docsrs, doc(cfg(feature = "nalgebra-v0_33")))]
pub mod nalgebra_v0_33;

#[cfg(feature = "fixed-v1_0")]
#[cfg_attr(docsrs, doc(cfg(feature = "fixed-v1_0")))]
pub mod fixed_v1_0;
#[cfg(feature = "serde-big-array-v0_5")]
#[cfg_attr(docsrs, doc(cfg(feature = "serde-big-array-v0_5")))]
pub mod serde_big_array_v0_5;

#[cfg(feature = "uuid-v1_0")]
#[cfg_attr(docsrs, doc(cfg(feature = "uuid-v1_0")))]
pub mod uuid_v1_0;

impl Schema for DataModelType {
const SCHEMA: &'static DataModelType = &DataModelType::Schema;
Expand Down
9 changes: 9 additions & 0 deletions source/postcard-schema/src/impls/serde_big_array_v0_5.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//! Implementations of the [`Schema`] trait for the `serde-big-array` crate v0.5.

use crate::{schema::DataModelType, Schema};

use serde_big_array_v0_5::Array;

impl<T: Schema, const N: usize> Schema for Array<T, N> {
const SCHEMA: &'static DataModelType = <[T; N] as Schema>::SCHEMA;
}