matrix-rust-sdk/examples
Benjamin Kampmann e8278b5d68
feat: add Result return value to sync_* (#1037)
Inspired by the changes in #1013 I was thinking about the use case for `sync_*` and how we handle error cases. Most notably while we give the callback the option to stop the loop, we don't really give an indication to the outside, how to interpret that cancellation: was there a failure? should we restart?

Take e.g. a connectivity issue on the wire, we'd constantly loop and just `warn`, what you might or might not see. Even if you handle that in the `sync_with_result_callback` and thus break the loop, the outer caller now still doesn't know whether everything is honky dory or whether they should restart. 

This Changes reworks that area by having all the `sync` return `Result<(), Error>`, where `()` means it was ended by the inner callback (which in `sync()` never occurs) or `Error` is the error either the inner `result_callback` found or the that was coming from the `send` in the first place. Thus allowing us to e.g. back down to sync as it was a dead wire or restart it if there was only a temporary problem. Making all that a just a bit more "rust-y".
2022-09-26 17:14:15 +02:00
..
appservice_autojoin refactor(appservice): Move example to top-level 2022-09-23 17:01:01 +02:00
autojoin feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
command_bot feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
cross_signing_bootstrap feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
custom_events feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
emoji_verification feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
get_profiles chore(examples): Use automatic links for some URLs 2022-08-31 18:43:47 +02:00
getting_started feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
image_bot feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
login feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
timeline feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
wasm_command_bot feat: add Result return value to sync_* (#1037) 2022-09-26 17:14:15 +02:00
README.md chore: rename Readme.md to README.md 2022-08-03 16:39:14 +02:00

README.md

Matrix SDK Examples

In this folder you find examples for using the matrix-sdk (and its various components) to implement specific common features, each as a separate crate. You can run each of them from the root of the repository, mind you that _ becomes - and the crate names are prefixed with example-. So to run the image bot example you can do cargo run -p example-image-bot.