• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

slide-rs / specs / 748 / 2
10%
master: 10%

Build:
DEFAULT BRANCH: master
Ran 04 Oct 2017 05:11PM UTC
Files 12
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Oct 2017 04:50PM UTC coverage: 89.965% (-0.2%) from 90.203%
748.2

push

travis-ci

bors[bot]
Merge #275

275: Add an ability to save and load entities. r=torkleyy a=omni-viral

Add (de)serialization support for entities to specs.
Main parts are:
* `Marker` trait.
`Marker` is used for several purposes:
  * Mark which entities should be serialized.
  * It contains ID to replace `Entity` stored in `Component`s during serialization process.
  * It may contain additional data to be used for tracking owner of the component.
* `MarkerAllocator` trait for allocating `Marker`s, storing `Marker -> Entity` mapping and other stuff.
* `SerializableComponent` trait that is auto implemented by components if they implements `Serialize`, `DeserializeOwned` and `Copy` (later is rather strict, maybe it should be replaced with `Clone` or removed somehow).
Mainly `Component` implements `SerializableComponent` manually when it contains `Entity`.
`Component` should replace `Entity` with provided `Marker` in `SerializableComponent::save` function. And replace `Marker` with `Entity` in `SerializableComponent::load` function.
* `Components` trait is implemented for tuples of `SerializableComponent`s
It allows to save all existing and mentioned in tuple components of one entity from `ReadStorage`s into serializable structure. And load it into `WriteStorage`s again.

Helper types `WorldSerialize` and `WorldDeserialize` are good example how to use this facility.

1022 of 1136 relevant lines covered (89.96%)

0.9 hits per line

Source Files on job 748.2
  • Tree
  • List 0
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 748
  • Travis Job 748.2
  • 5e2a2c2a on github
  • Prev Job for on master (#740.2)
  • Next Job for on master (#750.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc