summaryrefslogtreecommitdiff
path: root/crates/tor-rpcbase/src/method.rs
Commit message (Collapse)AuthorAgeFilesLines
* Add a few "TODO RPC" notesNick Mathewson2024-05-161-0/+3
|
* RPC: Fill in documentation about invoke_specialNick Mathewson2024-05-161-2/+5
|
* RPC: Require an Error type in methods.Nick Mathewson2024-05-161-0/+5
| | | | | | | | This is needed so that we can cast special methods' return types properly. I wish I could make this optional, but Rust doesn't allow defaulting an associated type.
* Relax Serialize requirement on method outputs.Nick Mathewson2024-05-161-3/+5
| | | | | Now Methods can return anything; and only if their outputs are Serialize will they implement RpcInvocable.
* rpc: Move typetag onto subtrait of DynMethodNick Mathewson2024-05-161-14/+33
| | | | | | This will allow us to create dispatchable methods that are only invoked from inside the arti code, and are not themselves serializable.
* RPC: Enforce method name format.Nick Mathewson2024-05-141-0/+71
| | | | | | | | | | | | We need to do this carefully, since we want our system to be extensible with new namespaces. First, when we are constructing an RpcMgr, we _warn_ about any method names that are misformed. Second, we add a test in the `arti` crate to fail if any method names are invalid. This will only catch method names in crates that `arti` depends on.
* rpc: Remove a limitation on DynMethod macro.Nick Mathewson2024-05-061-6/+5
| | | | It no longer requires the user to have `typetag` in scope.
* rpc: Revise backend for dispatchable-object macro.Nick Mathewson2024-04-221-11/+0
| | | | | | | | | 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.
* rpc: Move deftly attributes into an `rpc` namespace.Nick Mathewson2024-04-111-3/+3
|
* Refactor: remove existence of HasConstTypeId_ as a traitNick Mathewson2024-04-081-1/+12
| | | | | | | | | 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-041-20/+20
| | | | | | 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.
* Arti: Add ability to remember the list of methods names.Nick Mathewson2023-04-191-0/+36
| | | | | | | | | | | | Right now, this lets us say whether the method was unrecognized or whether the parameter type was incorrect. We'll use this to enforce correct method names later on. (I have to add another `inventory` here, since the `typetag` maintainer does not want to expose this functionality: see https://github.com/dtolnay/typetag/issues/57#issuecomment-1506106290 )
* rpc: Split Method into DynMethod and MethodNick Mathewson2023-04-191-9/+39
| | | | | Now `Method` has an Output and Update associated type, and `decl_method` can do a little more.
* tor-rpcbase: Rename cmd.rs to method.rs.Nick Mathewson2023-04-121-0/+52