matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

Include Ctx<T> in all examples

Open Skarlett opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. At the moment, without digging deep into the documentation - it was rather unclear to me for a few hours while trying to pick up this library how to include my own state. I attempted cloning an Arc<T> inside of register_event_handler, and was greeted with expected FnOnce got Fn - after a few hours I did find Ctx<T>

Describe the solution you'd like I think the majority of cases where people would like to use this library, would like to be able to pass data inside and out of their event handler.

Including Ctx<T> and adding a note that is isn't required would save alot time for the user.

Describe alternatives you've considered Alternatively, the readme file could use Ctx<T> in registering the event handler.

Additional context N/A

Skarlett avatar Jun 03 '22 23:06 Skarlett