fn serialize<S>(
        &self,
        entities: &EntitiesRes,
        markers: &ReadStorage<M>,
        serializer: S,
    ) -> Result<S::Ok, S::Error>
    where
        E: Display,
        S: Serializer,
    {
        let count = (entities, markers).join().count();
        let mut serseq = serializer.serialize_seq(Some(count))?;
        let ids = |entity| -> Option<M> { markers.get(entity).cloned() };
        for (entity, marker) in (entities, markers).join() {
            serseq.serialize_element(&EntityData::<M, Self::Data> {
                marker: marker.clone(),
                components: self
                    .serialize_entity(entity, &ids)
                    .map_err(ser::Error::custom)?,
            })?;
        }
        serseq.end()
    }
/// Serialize components from specified storages
/// of all marked entities with provided serializer.
/// When the component gets serialized the closure passed
/// in `ids` argument returns `None` for unmarked `Entity`.
/// In this case serialization of this component may perform workaround or
/// fail. So the function doesn't recursively mark referenced entities.
/// For recursive marking see `serialize_recursive`
Serialize components from specified storages
of all marked entities with provided serializer.
Serialize components from specified storages of all marked entities with provided serializer .
fn serialize<S>(
        &self,
        entities: &EntitiesRes,
        markers: &ReadStorage<M>,
        serializer: S,
    ) -> Result<S::Ok, S::Error>
    where
        E: Display,
        S: Serializer,
    {
        let count = (entities, markers).join().count();
        let mut serseq = serializer.serialize_seq(Some(count))?;
        let ids = |entity| -> Option<M> { markers.get(entity).cloned() };
        for (entity, marker) in (entities, markers).join() {
            serseq.serialize_element(&EntityData::<M, Self::Data> {
                marker: marker.clone(),
                components: self
                    .serialize_entity(entity, &ids)
                    .map_err(ser::Error::custom)?,
            })?;
        }
        serseq.end()
    }
fn serialize < S > ( & self , entities : & EntitiesRes , markers : & ReadStorage < M > , serializer : S , ) -> Result < S :: Ok , S :: Error > where E : Display , S : Serializer , { let count = ( entities , markers ) . join ( ) . count ( ) ; let mut serseq = serializer . serialize_seq ( Some ( count ) ) ? ; let ids = | entity | -> Option < M > { markers . get ( entity ) . cloned ( ) } ; for ( entity , marker ) in ( entities , markers ) . join ( ) { serseq . serialize_element ( & EntityData :: < M , Self :: Data > { marker : marker . clone ( ) , components : self . serialize_entity ( entity , & ids ) . map_err ( ser :: Error :: custom ) ? , } ) ? ; } serseq . end ( ) }
Serialize components from specified storages
of all marked entities with provided serializer.
Serialize components from specified storages of all marked entities with provided serializer .
&self
entities
&EntitiesRes
markers
&ReadStorage<M>
serializer
S