Commit Graph

11 Commits

Author SHA1 Message Date
baummarten 72d158513c Registration::new_with_client
Registration can now be created with a custom Reqwest Client.
2023-01-14 16:28:05 -05:00
Matthias Beyer c32f628c49 Make Registered::complete() accept an AsRef<str>
This patch changes the signature of `Registered::complete` to accept an
`AsRef<str>`. This _should_ be backwards compatible to the old version.

This change was implemented as it has the neat benefit that a user can
implement a type that does not implement `Debug` or `Display`, but only
`AsRef<str>`.
This can be done to ensure that the access code is not accidentially
shown in log output, which might be pasted to some code forge for bug
reporting.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2022-12-29 14:07:09 -05:00
Matthias Beyer c689b8390c Run cargo-fmt on whole codebase
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2022-12-29 07:14:00 -05:00
D. Scott Boggs f82725c9dc Add dependency on percent_encoding
percent_encoding used to be a part of url before v2.
2022-12-28 09:39:49 -05:00
Matthias Beyer f280c4b8fa
Fix clippy: Remove unnecessary lifetime specifier
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2022-12-27 15:55:59 +01:00
D. Scott Boggs 2ec3bd42ec Rename elefren to mastodon-async 2022-12-23 12:18:03 -05:00
D. Scott Boggs 648de8c8e5 Add read_response helper
This fixes a bug where a chunked response would be partially read and then hang forever waiting for another chunk, and adds additional debug logging to the request process.
2022-12-07 16:21:00 -05:00
D. Scott Boggs c9fc25a0c9 add logging 2022-12-07 15:58:28 -05:00
D. Scott Boggs e69d92f71e Update client to work asynchronously
- Use reqwest's async client
 - Convert items_iter() to a futures::Stream
 - make Mastodon client an Arc smart pointer, removing the need for OwnedPage.
 - remove MastodonClient and HttpSender traits; these can be re-added once async trait fns are stabilized
 - make EventStream a futures::Stream
2022-12-05 10:35:29 -05:00
D. Scott Boggs f054c7d805 Update Rust Edition; Update dependencies
Async needs added
2022-11-29 18:50:29 -05:00
D. Scott Boggs 96b16c62d9 initial state; elefren 0.22.0 2022-11-27 09:44:43 -05:00