object-chain 0.1.3

Ad-hoc structure builder
Documentation
  • Coverage
  • 68.75%
    11 out of 16 items documented1 out of 10 items with examples
  • Size
  • Source code size: 9.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.32 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • bugadani/object-chain
    0 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • bugadani

Object chain - build ad-hoc structures crates.io docs.rs

Object chains are static objects whose type depends on the objects you store in them. This data structure is useful if you need to collect different objects that implement a common functionality and you don't want heap allocation.

To get started, you need to create a Chain object by passing it your first object. Use the append method to add more objects to your chain. If you need to pass the chain around, you can use impl ChainElement or, if you need to be explicit about the type, the chain! macro.

If you want to access the elements inside, you'll need to implement a common trait for your objects and an accessor interface for Chain and Link. You can see an example in the source code.