[−][src]Struct amethyst_editor_sync::SerializableEntity
Helper type that wraps an Entity to provide serialization support.
Entity does not directly implement Serialize because it rarely makes sense to
serialize an entity directly. Specs encourages users to treat entities as a collection of
components, and to only serialize component data while letting the entity be implicit.
For the purposes of the editor, though, we would like to be able to reason about entities
directly. SerializableEntity acts as a minimal wrapper around Entity that provides
serialization support. You can use it in your components instead of Entity so that you
can #[derive(Serialize)] for your component type and display it in the editor.
Note that SerializableEntity does not support deserialization. A robust solution for
component deserialization is more complex than what is necessary for the editor at this point.
Users interested in full deserialization of entities should have a look at the saveload
functionality in specs.
Methods
impl SerializableEntity[src]
pub fn new(entity: Entity) -> Self[src]
Creates a new SerializableEntity from an Entity.
pub fn id(&self) -> u32[src]
Gets the ID of the entity.
pub fn gen(&self) -> Generation[src]
Gets the generation of the entity.
Trait Implementations
impl Copy for SerializableEntity[src]
impl From<Entity> for SerializableEntity[src]
impl From<SerializableEntity> for Entity[src]
fn from(from: SerializableEntity) -> Self[src]
impl Clone for SerializableEntity[src]
fn clone(&self) -> SerializableEntity[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for SerializableEntity[src]
impl Serialize for SerializableEntity[src]
Auto Trait Implementations
impl Send for SerializableEntity
impl Sync for SerializableEntity
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> Erased for T
impl<T> Downcast for T where
T: Any,
T: Any,