diff options
| author | Crozet Sébastien <developer@crozet.re> | 2020-11-02 15:07:50 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2020-11-02 15:08:46 +0100 |
| commit | 01af6c09a786ec2d6475531a7dac873eeffa3a3e (patch) | |
| tree | 2f7a31860f31771571535effe75db426f7eb63ea /src/data/maybe_serializable_data.rs | |
| parent | 4b8242b9c267a9412c88793575db37f79c544ca2 (diff) | |
| download | rapier-01af6c09a786ec2d6475531a7dac873eeffa3a3e.tar.gz rapier-01af6c09a786ec2d6475531a7dac873eeffa3a3e.tar.bz2 rapier-01af6c09a786ec2d6475531a7dac873eeffa3a3e.zip | |
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); |
