diff options
| author | Robert Hrusecky <robert.hrusecky@utexas.edu> | 2020-11-02 15:00:12 -0600 |
|---|---|---|
| committer | Robert Hrusecky <robert.hrusecky@utexas.edu> | 2020-11-02 15:00:12 -0600 |
| commit | 8b81a3fd2727dcb911f19c3d7a98c4ec94c6f2fa (patch) | |
| tree | b59ce89ff5d1e0505cdf2b7b91740a48763efa76 /src/data/maybe_serializable_data.rs | |
| parent | bcec54ef31d987cf20b493628a20777183a95f65 (diff) | |
| parent | a38fdc101dc74473c45a8b4f5d770f2bc43f30c2 (diff) | |
| download | rapier-8b81a3fd2727dcb911f19c3d7a98c4ec94c6f2fa.tar.gz rapier-8b81a3fd2727dcb911f19c3d7a98c4ec94c6f2fa.tar.bz2 rapier-8b81a3fd2727dcb911f19c3d7a98c4ec94c6f2fa.zip | |
Merge branch 'master' into infinite_fall_memory
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); |
