austinjones / lifeline-rs

A dependency injection library for message-based applications
MIT License
38 stars 3 forks source link

Documentation for using Resources is confusing/missing #61

Closed KerfuffleV2 closed 1 year ago

KerfuffleV2 commented 3 years ago

In the documentation for Resource and Bus, it only says it "attaches a resource to the bus". However, there's no example of using a resource in Resource and the examples snippets that exist in Bus show creating the bus and then immediately trying to take a resource (which I assume would always fail). None of the example programs use Resource either as far as I can see.

After reading the documentation and examples, I had no idea of how resources got onto a Bus - it seemed like maybe they were created via the Default trait but the documentation didn't say that was required. I eventually found an example looking through your tab-rs project but having to read through a large project isn't ideal.

Unfortunately, the store_resource function is hidden away in the dyn_bus module - which I didn't even look at since it seemed like it was a low-level module that the higher level interfaces were built on. It would be helpful to at least mention the existence of store_resource in the Bus and Resource documentation.

I hope this doesn't come off as entitled. Your project looks interesting!

KerfuffleV2 commented 1 year ago

It's a shame this project seems to have died. It actually looked really interesting/useful.