diff options
| author | Sébastien Crozet <developer@crozet.re> | 2020-11-02 18:43:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-02 18:43:07 +0100 |
| commit | 9c72a0458b89741ce31744efa2d33f4b75de0d79 (patch) | |
| tree | 1da50d34e9342d99a6f15168862e9572b9127e6a /src/data/maybe_serializable_data.rs | |
| parent | 4b8242b9c267a9412c88793575db37f79c544ca2 (diff) | |
| parent | 83482602717d1a9aebb181fb82456a292801cbdc (diff) | |
| download | rapier-9c72a0458b89741ce31744efa2d33f4b75de0d79.tar.gz rapier-9c72a0458b89741ce31744efa2d33f4b75de0d79.tar.bz2 rapier-9c72a0458b89741ce31744efa2d33f4b75de0d79.zip | |
Merge pull request #49 from dimforge/determinism_bug
Fix simulation reaching different states when started from different snaphots
Diffstat (limited to 'src/data/maybe_serializable_data.rs')
| -rw-r--r-- | src/data/maybe_serializable_data.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/data/maybe_serializable_data.rs b/src/data/maybe_serializable_data.rs new file mode 100644 index 0000000..db38963 --- /dev/null +++ b/src/data/maybe_serializable_data.rs @@ -0,0 +1,14 @@ +use downcast_rs::{impl_downcast, DowncastSync}; +#[cfg(feature = "serde-serialize")] +use erased_serde::Serialize; + +/// Piece of data that may be serializable. +pub trait MaybeSerializableData: DowncastSync { + /// Convert this shape as a serializable entity. + #[cfg(feature = "serde-serialize")] + fn as_serialize(&self) -> Option<(u32, &dyn Serialize)> { + None + } +} + +impl_downcast!(sync MaybeSerializableData); |
