summaryrefslogtreecommitdiff
path: root/crates/arti-rpcserver/src/msgs.rs
Commit message (Collapse)AuthorAgeFilesLines
* rpc: Rename the error codes for something like consistency.Nick Mathewson2024-07-251-1/+1
|
* rpc: Remove RpcError data field and use ReportNick Mathewson2024-07-251-1/+1
| | | | | | | | | | | | Per discussion, this field isn't really specified in a way that lets us fill it sensibly at the moment. So for now, we're going to just omit it. Additionally, we said that we'd Report on our errors; this branch changes the implementation of RpcError to do that. Question: Will the blanket implementation for Into<RpcError> make it harder to re-add a Data field later on if we want to do so?
* rpc: Refactor errors part 1: a new RpcMethod trait.Nick Mathewson2024-07-251-2/+1
| | | | | It is no longer necessary to say, for every RPC method, that its error type is RpcError.
* RPC: Require an Error type in methods.Nick Mathewson2024-05-161-0/+1
| | | | | | | | 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.
* rpc: Move typetag onto subtrait of DynMethodNick Mathewson2024-05-161-1/+1
| | | | | | This will allow us to create dispatchable methods that are only invoked from inside the arti code, and are not themselves serializable.
* rpc: Move deftly attributes into an `rpc` namespace.Nick Mathewson2024-04-111-1/+1
|
* Refactor: remove existence of HasConstTypeId_ as a traitNick Mathewson2024-04-081-1/+1
| | | | | | | | | 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-3/+5
| | | | | | 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.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Fix typosDimitris Apostolou2023-07-221-1/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Arti: Add ability to remember the list of methods names.Nick Mathewson2023-04-191-1/+5
| | | | | | | | | | | | 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-12/+15
| | | | | Now `Method` has an Output and Update associated type, and `decl_method` can do a little more.
* rpc: Change `id=<SYNTAX>` to "no id".Nick Mathewson2023-04-131-6/+21
| | | | | | | Now instead of hoping that buggy clients will detect a magic `id`, we can simply tell them that they will get no `id` at all. If they can't handle that case, no major harm is done: the connection will get closed anyway.
* rpc: Require that errors are RpcError.Nick Mathewson2023-04-131-4/+2
| | | | | | Since we're serializing everything in this format, let's enforce it. With this change, we can no longer cram arbitrary junk into an RPC error, so we have to clean up our handling of cancelled requests.
* rpc: Improve error reporting for invalid requestsNick Mathewson2023-04-121-1/+93
| | | | | | | | | | | | | | | | This is a bit big, but it's not that _complicated_. The idea here is that we use serde's "untagged" enum facility when parsing our `Request`s, such that if parsing as a `Request` fails, we parse as an `InvalidRequest` and try to report what the problem was exactly. This lets us determine the ID of a request (if it had one), so we can report that ID in our error message. We can also recover from a much broader variety of errors. We now also conform with the spec reporting errors about completely wrong json, requests without IDs, and so on.
* arti-rpcserver: Be careful about saying "result".Nick Mathewson2023-04-121-5/+10
| | | | | | Even though json-rpc uses "result" to mean "a successful return value from a method", we can't: Rust's `Result` type is so pervasive that confusion would be inevitable.
* arti-rpcserver: rename command to method.Nick Mathewson2023-04-121-8/+8
|
* tor-rpcbase: Rename and rephrase "command" to "method"Nick Mathewson2023-04-121-3/+3
|
* Rename tor-rpccmd to tor-rpcbase.Nick Mathewson2023-04-121-2/+2
|
* rpc: Rename BoxedResponseBody => ResponseBodyNick Mathewson2023-04-121-10/+10
|
* rpc: Add standard warnings to arti-rpcserverNick Mathewson2023-04-121-2/+3
|
* rpc: Wire up arti-rpcserver to use tor-rpccmd.Nick Mathewson2023-04-121-0/+6
|
* rpc: do a better job of hiding impl_const_type_id!Nick Mathewson2023-04-121-1/+2
|
* RPC: Initial implementation of a multiple-argument dispatchNick Mathewson2023-04-121-0/+1
| | | | | | | | | | This code uses some kludges (discussed with Ian previously and hopefully well documented here) to get a type-identifier for each type in a const context. It then defines a macro to declare a type-erased versions of a concrete implementation functions, and register those implementations to be called later. We will probably want to tweak a bunch of this code as we move ahead.
* Start on a lower-level tor-rpccmd crate.Nick Mathewson2023-04-121-35/+10
| | | | | This crate will hold the backend pieces of RPC interaction that different parts of Arti get to implement.
* rpc: Implement json message types for serde.Nick Mathewson2023-04-121-0/+214