summaryrefslogtreecommitdiff
path: root/crates/tor-basic-utils/src
Commit message (Collapse)AuthorAgeFilesLines
* Typo fixes (automated with "typos").Nick Mathewson2022-05-241-4/+4
|
* Suppress clippy warnings in tor-basic-utils.Nick Mathewson2022-05-232-0/+2
| | | | These are warnings that we've decided it's okay to suppress elsewhere.
* prepare_send_from: clippy: Have dprintln explicitly return ()Ian Jackson2022-05-231-1/+1
|
* prepare_send_from: clippy: Avoid a lintIan Jackson2022-05-231-2/+1
| | | | I think this is worse code, but it's not *significantly* worse.
* prepare_send_from: clippy: Add missing docsIan Jackson2022-05-231-11/+18
| | | | I intend to reintroduce this in its own MR.
* prepare_send_from: clippy: Replace two unwrapsIan Jackson2022-05-231-2/+6
|
* prepare_send_from: Break out get_output! macroIan Jackson2022-05-231-2/+11
| | | | So we can change unwrap to expect, which makes this too long to repeat.
* prepare_send_from: docs and comments improvementsIan Jackson2022-05-231-13/+115
| | | | Apropos review.
* prepare_send_from: Add testsIan Jackson2022-05-231-0/+122
| | | | | | When I added these tests, they didn't find any bugs in my own implementation, but I did find a bug in futures::future::unfold. See the in-code comment.
* channel: Provide and use Sink::prepare_send_fromIan Jackson2022-05-232-0/+293
| | | | | | | | | | | | | | | | | | | | This is a general-purpose implementation of the ad-hoc approach currently taken in (eg) crates/tor-proto/src/channel/reactor.rs, with an API intended to defned against the more obvious mistakes. This allows us to separate the two concerns: the channel reactor can focus on handling channel cells and control messages and is over 2.5x shorter. The complexity of the manual sink implementation, and the machinery needed to avoid having to suspend while holding an item, are dealt with separately. That separate implemenation now has proper documentation. (Tests are in the nest commit to avoid this one being even more unwieldy.) We use `extend` to define this as an extension trait. A competitor is `ext` but in my personal projects I have found `extend` slightly better.
* Rename macro_first_nonempty (from macro_coalesce_args)Ian Jackson2022-04-251-2/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798026
* macro_coalesce_args: New helper macroIan Jackson2022-04-251-0/+30
|
* tor-basic-utils: Add RetryDelay::reset testSamanta Navarro2022-04-231-0/+2
|
* Add RetrySchedule::reset()Nick Mathewson2022-04-041-0/+5
| | | | | | | | | | | Previously the code would do stuff like ``` schedule = RetrySchedule::new(INITIAL_DELAY); ``` which is needlessly verbose, since the schedule already keeps track of its initial delay.
* Adjust a commentIan Jackson2022-03-211-1/+1
| | | | Noticed this while reviewing !426
* Provide define_accessor_trait and use it to generate CircMgrConfigIan Jackson2022-03-161-0/+68
|
* RetryDelay: remove accessors.Nick Mathewson2022-03-161-17/+1
| | | | Instead, check initial_delay in dirmgr directly.
* Fix up documentation on RetryDelay.Nick Mathewson2022-03-161-10/+19
| | | | | It's no longer about downloads; it's about whatever you need to retry.
* Move RetryDelay from dirmgr to basic-utils.Nick Mathewson2022-03-162-0/+168
| | | | | This (almost) a pure code-movement commit: it also makes one public function private in order to suppress a warning.
* Revert "humantime_serde_option: New module in tor-basic-utils"Ian Jackson2022-03-142-27/+0
| | | | | | We have upstreamed this code. This reverts commit 6193c9d9742d1d19a45a0ee1c383858201304912.
* humantime_serde_option: New module in tor-basic-utilsIan Jackson2022-03-072-0/+27
| | | | | This will be used to allow our config *builder* structs to be Deserialize.
* tor-basic-utils: copy the README into lib.rsIan Jackson2022-03-041-1/+11
| | | | | | | | | | The doc include rune does not work with our MSRV; it needs 1.54. The alternative would be some kind of cfg() but that would - not provide the crate-level doc on Rust 1.53 - involve the use of cfg_attr Instead, just do it the old way.
* Remove now-obsolete note about location of skip_fmtIan Jackson2022-03-041-5/+0
| | | | Now the diff from the merge base does not contain any hits for ^\+.*bytes
* Move skip_fmt into tor-basic-utilsIan Jackson2022-03-041-0/+37
| | | | | | | Code motion and the minimal mechanical changes. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/375#note_2783078
* Introduce tor-basic-utilsIan Jackson2022-03-041-0/+30
Empty crate right now