Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization #46

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Serialization #46

wants to merge 9 commits into from

Conversation

jondo2010
Copy link
Owner

@jondo2010 jondo2010 commented Oct 13, 2024

This is the first slice of #47, enabling serialization of the Env and ReactionGraph structs that get output from the builder stage.

Support for trait objects of user types is enabled through a type registry.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

clippy

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/reactor.rs:22:12
   |
22 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
   |            ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]


🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/reactor.rs:27:16
   |
27 |     #[cfg_attr(feature = "serde", serde(skip))]
   |                ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

#[cfg_attr(feature = "serde", serde(skip))]

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

clippy

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/reactor.rs:22:12
   |
22 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
   |            ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]


🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/reactor.rs:27:16
   |
27 |     #[cfg_attr(feature = "serde", serde(skip))]
   |                ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

#[cfg_attr(feature = "serde", serde(skip))]


/// Typed Action state, storing potentially different values at different Tags.
#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/action/mod.rs:19:12
   |
19 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
   |            ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

pub store: Arc<Mutex<dyn BaseActionStore>>,
}

#[cfg(feature = "serde")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/action/mod.rs:49:7
   |
49 | #[cfg(feature = "serde")]
   |       ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

@@ -85,6 +113,7 @@ impl<'a> From<&'a mut Action> for &'a mut PhysicalAction {
}

#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
   --> boomerang_runtime/src/action/mod.rs:116:12
    |
116 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
    |            ^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
    = help: consider adding `serde` as a feature in `Cargo.toml`
    = note: see  for more information about checking conditional configuration

pub struct PhysicalAction {
pub name: String,
pub key: ActionKey,
pub min_delay: Duration,
#[cfg_attr(feature = "serde", serde(with = "serialize_physical_action_store"))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/action/mod.rs:45:16
   |
45 |     #[cfg_attr(feature = "serde", serde(with = "serialize_physical_action_store"))]
   |                ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

where
T: ActionData,
{
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/action/store.rs:25:12
   |
25 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
   |            ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

}
}

impl<'store, F> ReactionFn<'store> for F
#[cfg(feature = "serde")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
   --> boomerang_runtime/src/reaction.rs:159:7
    |
159 | #[cfg(feature = "serde")]
    |       ^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
    = help: consider adding `serde` as a feature in `Cargo.toml`
    = note: see  for more information about checking conditional configuration

@@ -115,34 +211,115 @@ impl Debug for Deadline {
}
}

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
   --> boomerang_runtime/src/reaction.rs:214:12
    |
214 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
    |            ^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
    = help: consider adding `serde` as a feature in `Cargo.toml`
    = note: see  for more information about checking conditional configuration

pub struct Reaction {
name: String,
/// Reaction closure
pub(crate) body: BoxedReactionFn,
/// Local deadline relative to the time stamp for invocation of the reaction.
#[cfg_attr(feature = "serde", serde(skip))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
   --> boomerang_runtime/src/reaction.rs:221:16
    |
221 |     #[cfg_attr(feature = "serde", serde(skip))]
    |                ^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
    = help: consider adding `serde` as a feature in `Cargo.toml`
    = note: see  for more information about checking conditional configuration


pub struct Reactor {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/reactor.rs:22:12
   |
22 | #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
   |            ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

/// The reactor name
name: String,
/// The ReactorState
pub(crate) state: Box<dyn ReactorState>,
#[cfg_attr(feature = "serde", serde(skip))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [clippy] reported by reviewdog 🐶

error: unexpected `cfg` condition value: `serde`
  --> boomerang_runtime/src/reactor.rs:27:16
   |
27 |     #[cfg_attr(feature = "serde", serde(skip))]
   |                ^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `erased-serde`, `linkme`, `parallel`, and `paste`
   = help: consider adding `serde` as a feature in `Cargo.toml`
   = note: see  for more information about checking conditional configuration

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 68.73449% with 126 lines in your changes missing coverage. Please review.

Project coverage is 78.10%. Comparing base (636ff7d) to head (fff46aa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
+ Coverage   77.30%   78.10%   +0.80%     
==========================================
  Files          48       47       -1     
  Lines        5930     5969      +39     
==========================================
+ Hits         4584     4662      +78     
+ Misses       1346     1307      -39     
Components Coverage Δ
boomerang 100.00% <ø> (ø)
boomerang_derive 89.13% <100.00%> (+0.03%) ⬆️
boomerang_runtime 78.01% <61.82%> (-1.87%) ⬇️
boomerang_tinymap 88.13% <78.26%> (-1.15%) ⬇️
boomerang_util 26.92% <83.33%> (+16.14%) ⬆️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant