bevy/crates/bevy_ecs/hecs/src/serde.rs

14 lines
288 B
Rust
Raw Normal View History

2020-07-10 08:37:06 +00:00
// modified by Bevy contributors
2020-07-10 04:18:35 +00:00
use crate::entities::Entity;
use serde::{Serialize, Serializer};
impl Serialize for Entity {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_u32(self.id())
}
}