summaryrefslogtreecommitdiff
path: root/crates/tor-rpcbase
Commit message (Collapse)AuthorAgeFilesLines
* Bump versions of 0.x tor-* and arti-* cratesIan Jackson2024-04-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for p in `cat ../u`; do cargo set-version --locked --offline -p $p; done where u contains tor-basic-utils tor-async-utils tor-error tor-config tor-units tor-geoip tor-rtcompat tor-rtmock tor-log-ratelim tor-rpcbase tor-memquota tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-hyper
* tor-rpcbase: Add a missing `#[doc(hidden)]`Ian Jackson2024-04-291-0/+1
| | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2103#note_3024372 I overlooked this.
* tor-rpcbase: invoker_ent!: simplify argument parsingIan Jackson2024-04-251-12/+15
| | | | | | Previously, one of the macros was documented to accept `(function_expr)`, but in fact it would only accept an identifier. Now we *do* accept any expression.
* tor-rpcbase: invoker_ent!: abolish flags argumentIan Jackson2024-04-251-19/+9
| | | | | | | | IMO if we want flags again in the future, we should probably pick a syntax that doesn't involve such awkward patterns. Perhaps `$expr $( , $( $flag )* )?`. But I think we probably won't need that feature.
* tor-rpcbase: invoker_ent: Infer the correct fn type for castIan Jackson2024-04-251-7/+69
| | | | | This renders the Update flag redundant. Indeed, in this commit we mow ignore the flags.
* tor-rpcbase: invoker_ent!: remove buggy unuseable armIan Jackson2024-04-251-3/+0
| | | | | | | | | This arm puts parens around its argument. But the other arm insists on $func:ident, and also would capture any reasonable input. This was probably something to do with the (func_expr) syntax. We don't need to *fix* this macrology, because in a moment the whole macro can be made to take $func:expr.
* rpc: add a comment from diziet to explain why we need same_declNick Mathewson2024-04-221-0/+6
|
* rpc: reformat macro slightly.Nick Mathewson2024-04-221-2/+5
|
* Rename Invoker trait to Invocable.Nick Mathewson2024-04-221-15/+15
|
* Fix rustdoc links.Nick Mathewson2024-04-221-2/+2
|
* Adjust an allow.Nick Mathewson2024-04-221-1/+1
|
* rpc:Sketch out the syntax of our remaining tricky macrosNick Mathewson2024-04-221-2/+8
|
* RPC: Remove installable_rpc_invoke_fnNick Mathewson2024-04-221-128/+68
| | | | | | | | | | | | | | | Now that we've done more refactoring, it's no longer necessary to have this machinery, since: * We can support statically registering instantiated methods, if we know them ahead of time. * Writing an installer function is pretty simple, and the syntax is much nicer than the special-purpose junk we had before. I've added examples of both approaches. While we're at it, I've simplified the syntax for `invoker_ent!` a little, since the parentheses I had before aren't necessary.
* RPC: Remove method and object type from macros.Nick Mathewson2024-04-221-20/+18
| | | | | These are no longer needed, since they are inferred from the types of the functions.
* rpc: Revise backend for dispatchable-object macro.Nick Mathewson2024-04-225-260/+261
| | | | | | | | | The trick here is to provide an `Invoker` trait, with blanket implementations for appropriate `fn(_,_,_,_?) -> _`. With this trick, we no longer need to have a `decl_rpc_invoke_fn`. This lets us discard HasConstTypeId entirely, and will let us simplify some other syntax moving forward.
* Add TODO RPC items from review.Nick Mathewson2024-04-112-0/+9
|
* Fix a comment.Nick Mathewson2024-04-111-2/+1
|
* rpc: Add a missing not() to generic test.Nick Mathewson2024-04-111-1/+1
|
* Upgrade derive-deftly requirement to 0.10.3Nick Mathewson2024-04-111-1/+1
| | | | We're taking this for the fix to derive-deftly#52.
* Remove a duplicate $twheres.Nick Mathewson2024-04-111-1/+1
|
* rpc: Adjust a TODO comment.Nick Mathewson2024-04-111-1/+1
|
* rpc: Move deftly attributes into an `rpc` namespace.Nick Mathewson2024-04-114-18/+18
|
* Add generic support for RPC objects.Nick Mathewson2024-04-081-8/+200
| | | | | | | | | Since we can't enumerate every instantiation at compile time, we instead provide a macro to generate an _installer_ function that installs a set of functions for a given instantiation. Due to the limitations of macro_rules, the syntax for generics is a bit ugly.
* Refactor invoke_fn macro to make inventory optionalNick Mathewson2024-04-081-14/+19
| | | | | Now there is an `decl_rpc_invoke_fn` macro that *only* declares the type-erased functions. Another macro's job will be to register it.
* Globally rename rpc_invoke_fn to static_rpc_invoke_fnNick Mathewson2024-04-081-11/+11
| | | | | | | | This will be called _static_ to make it clear that it registers the method statically, so you don't need to install it at runtime. After a bit more work, there will be a separate macro that declares an installer function.
* Refactor: remove existence of HasConstTypeId_ as a traitNick Mathewson2024-04-085-49/+48
| | | | | | | | | We don't actually need this to be a trait; we just need methods and objects to have a `CONST_TYPE_ID_` if they want to participate in the inventory-based method registry. Removing this trait makes it much simpler to declare methods and objects.
* Port many of the macros in tor-rpcbase to use derive-deftly.Nick Mathewson2024-04-047-197/+207
| | | | | | This simplifies our implementation logic in a few places, and simplifies our invocation syntax greatly. There are a few infelicities, noted in `TODO RPC` comments.
* rpcbase: Require that every Object is Send + Sync + 'staticNick Mathewson2024-04-041-2/+2
| | | | | (We don't plan to have any Object that can't be used as an `Arc<dyn Object>`.)
* Update unstable `tor/arti-*` crates to 0.17.0.Nick Mathewson2024-04-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with: ``` CRATES=" tor-basic-utils tor-async-utils tor-error tor-config tor-events tor-units tor-geoip tor-rtcompat tor-rtmock tor-log-ratelim tor-rpcbase tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-hspow tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-congestion tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-config arti-hyper arti-bench arti-testing " for crate in $CRATES; do cargo set-version -p "$crate" 0.17.0 done ```
* Run maint/add_warning.Nick Mathewson2024-03-135-0/+5
|
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Bump minor versionsIan Jackson2024-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump the minor version of these crates, and update the in-tree dependencies. Recently published as fresh crates, let's just assume there are breaking changes: fslock-guard test-temp-dir Breaking API change affecting many many downstream crates: tor-rtcompat Downstream crates which we're (conservatively) assuming have tor-rtcompat types in their APIs: tor-rtmock tor-log-ratelim tor-rpcbase tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-hspow tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-congestion tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-config arti-hyper arti-bench arti-testing
* tor-rpcbase: Add an allowIan Jackson2024-01-311-0/+1
|
* Bump to latest erased-serde.Nick Mathewson2024-01-091-1/+1
|
* Breaking version bumps in preparation for 1.1.12.Nick Mathewson2024-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have breaking changes on their own: tor-error tor-netdoc tor-dirmgr tor-keymgr Because of the breaking change in tor-error, and the fact that basically every crate publicly depends on tor-error (by implementing ErrorKind), we need to call this a breaking change on all of the following: tor-config tor-geoip tor-rtmock tor-log-ratelim tor-rpcbase tor-bytes tor-hscrypto tor-socksproto tor-cell tor-proto tor-netdoc tor-netdir tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-config arti-hyper arti-testing
* Two more patchlevel bumpsNick Mathewson2023-12-041-1/+1
| | | | | | | | | These crates both depend on tor-error. Since tor-error got a patchlevel bump, they now depend on the new version, which means by our rules that _they_ get a patchlevel bump themselves. tor-geoip tor-rpcbase
* Bump patchlevel versions in preparation for releaseNick Mathewson2023-12-041-1/+1
| | | | | | | | | | | | | | | These crates had backward-compatible changes, and get a patchlevel bump only: fs-mistrust tor-error tor-config tor-rtcompat tor-rtmock This crate exposes no non-CLI APIs, and gets a patchlevel bump only: arti
* In every crate, change rust-version to 1.70.Nick Mathewson2023-11-281-1/+1
|
* no-dependant bumps for crates with changed dependencies.Nick Mathewson2023-10-311-1/+1
| | | | | | | tor-rpcbase patchlevel only, depends on async-utils. tor-llcrypto patchlevel only, depends on basic-utils. tor-hspow patchlevel only, depends on hscrypto. tor-linkspec patchlevel only, depends on basic-utils
* Patch version bumps in crates without breaking changesNick Mathewson2023-10-311-1/+1
| | | | | | | | | | | | | | | | | | ``` These crates have new APIs: tor-async-utils ADDED tor-config ADDED tor-hscrypto ADDED tor-netdoc ADDED, plus BREAKING-experimental. These crates have patch-level changes only: tor-netdir (bugfix only). (re-exposes netdoc) arti-rpcserver (tweaks only, uses nothing that broke.) arti 1.1.10, no stable public APIs. ```
* Bump patchlevel (not dependents) on crates with trivial changesNick Mathewson2023-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: ``` tor-basic-utils caret fs-mistrust safelog retry-error tor-events tor-units tor-geoip tor-rtcompat tor-rpcbase tor-protover tor-socksproto tor-checkable tor-congestion tor-persist tor-circmgr arti-rpcserver arti-config arti-hyper arti-bench arti-testing tor-consdiff ```
* Update patchlevel for crates with nontrivial changes.Nick Mathewson2023-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are: ``` hashx equix tor-async-utils tor-error tor-config tor-rtmock tor-llcrypto tor-bytes tor-hscrypto tor-hspow tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-netdir tor-chanmgr tor-guardmgr tor-dirmgr tor-keymgr tor-hsclient tor-hsservice arti-client arti ```
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-235-0/+5
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Bump patchlevel versions of crates with trivial changesNick Mathewson2023-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have had trivial changes only: typically, changes to documentation or to clippy warnings. There's no good reason to update which version of them other crates depend on, so we only bump _their_ patchlevels. ``` tor-async-utils caret safelog tor-events tor-units tor-rtcompat tor-rpcbase tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-socksproto tor-cert tor-cell tor-consdiff tor-congestion arti-rpcserver arti-testing arti-bench arti-config arti-hyper ```
* Increment patchlevel versions of crates with minor changesNick Mathewson2023-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates are at version 0.x.y, so we don't need to distinguish new-feature changes from other changes: ``` tor-basic-utils fs-mistrust tor-error tor-geoip tor-checkable tor-linkspec tor-netdoc tor-netdir tor-persist tor-ptmgr tor-hsservice ``` This crate has a breaking change, but only when the semver-breaking feature `experimental-api` is enabled: ``` tor-config ``` This crate is at version 1.x.y, but has no new public APIs, and therefore does not need a minor version bump: ``` arti ```
* Fix typosDimitris Apostolou2023-07-221-1/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-106-0/+6
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.