summaryrefslogtreecommitdiff
path: root/crates/arti-client/examples/lazy-init.rs
Commit message (Collapse)AuthorAgeFilesLines
* Make all TorClient constructors wrap the TorClient in an Arc.Nick Mathewson2026-05-131-3/+4
| | | | | | This is part of rationalizing the structure of TorClient so we can refactor startup logic, and so that RPC code can reason about object identity. See #2469.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* arti-client: Modified MSRV TODO for `once_cell` removalhashcatHitman2025-08-201-7/+1
| | | | | | | | | - Shortened the TODO added in a42413626abb57ad5610c8a73bfdd09ac68ac472 in the style of [this maintainer request] for consistency. [this maintainer request]: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2953#note_3197719 Signed-off-by: hashcatHitman <[email protected]>
* arti-client: Added TODO about replacing OnceCellhashcatHitman2025-04-171-0/+7
| | | | | - [`once_cell::sync::OnceCell`] should be replaced by [`std::sync::OnceLock`] once the blocking methods are stabilized and within our MSRV.
* Adjust examples lints using add_warningNick Mathewson2024-05-071-3/+3
|
* Add unknown-lints exception to examplesNick Mathewson2024-03-131-0/+1
| | | | | We need this to avoid warnings when runnning non-nightly clippy on these examples.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-121-0/+1
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* clippy: Consolidate many lints in maint/add_warningIan Jackson2022-06-241-0/+3
| | | | | | Found these by disabling the nightly dbg macro special case. Now, we have a mechanism for globally adding suppressions to tests, we can use that instead.
* clippy: Add standard test lint block to several examplesIan Jackson2022-06-241-0/+6
|
* arti-client: use PreferredRuntime by default, doc cleanupseta2022-02-281-7/+4
| | | | | | | | | | | | | | | | | | | | | | This makes using the `PreferredRuntime` the first-class option inside `arti-client`, freeing users who don't want to think about runtimes from having to do so. `TorClient::create_unbootstrapped` and `builder` now automatically use this runtime, leaving only `builder_custom` for users who wish to manually specify a runtime. This lets us clean up the docs a lot: mentions of using custom runtimes are now relegated to nearer the end of the crate-level documentation, and we mostly just link to `tor_rtcompat`'s docs to explain more there. Instead, we take some more time to explain how you use the builder API to create clients synchronously. Other doc cleanups included getting rid of the explanation of `TorAddr` in the main crate-level doc; this is already well-documented elsewhere, and is something users should discover organically later. fixes arti#326
* Make a TorClientBuilder API.Nick Mathewson2022-02-181-7/+5
| | | | | | | | This is a defensive API choice to protect against the possibility that we'll want to add a bunch of other non-config options in the future. Closes #350
* arti-client: add ability to automatically bootstrapeta2022-02-161-0/+76
The new `BootstrapBehavior` enum controls whether an unbootstrapped `TorClient` will bootstrap itself automatically (`Ondemand`) when an attempt is made to use it, or whether the user must perform bootstrapping themselves (`Manual`). The `lazy-init` example shows how you could write a simple `get_tor_client()` function that used a global `OnceCell` to share a Tor client across an entire application with this API. closes arti#278