summaryrefslogtreecommitdiff
path: root/crates/tor-cell/src/restrict.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove a couple of unused imports.Nick Mathewson2025-10-161-1/+0
|
* Fix indentation from last commit.Nick Mathewson2024-05-071-33/+33
|
* tor-cell: Allow unuexpected_cfgs in restricted macro.Nick Mathewson2024-05-071-0/+7
| | | | (We need this to permit our usage of our $omit_from hack.)
* tor-cell: Stop using deprecated name in doctestNick Mathewson2023-12-141-2/+2
|
* tor-cell: Implement {Relay,Chan}Msg for every body typeNick Mathewson2023-02-151-5/+3
| | | | | This will make it ergonomic to decode a single body type without having to declare a variant that accepts only a single message.
* tor-cell: Return a useful error when restrist_msg rejects a command.Nick Mathewson2023-02-091-2/+3
|
* Change tor_bytes::Error::BadMessage to a Cow.Nick Mathewson2023-02-091-1/+1
| | | | | | | | | | Actually, to avoid making a breaking change, I'm deprecating BadMessage and creating a new InvalidMessage variant that takes a Cow. This way I don't need to track every crate that re-exposes tor_bytes::Error and call this a breaking change in those. Making this change will allow tor_bytes errors to be much more helpful.
* tor-cell: Re-export paste so restrict_msg can work outside the crate.Nick Mathewson2023-02-091-3/+3
|
* tor-cell: Make RelayEarly a separate type.Nick Mathewson2023-02-091-4/+0
| | | | This allows us to remove a shenanigan from `restricted_msg!{}`.
* tor-cell: Have restrict_msg add conversion functions.Nick Mathewson2023-02-091-6/+67
| | | | | | | | | | | | | | | | Every FooMsg type now implements Into<AnyFooMsg>, and TryFrom<FooMsg>. Additionally, it now implements From<X> for every distinct type that it supports. This last part lets us discard a bunch of code. Unfortunately, I needed some downright hackish trickery in order to get these macros to avoid generating `From<AnyFooMsg> for AnyFooMsg` and conflicting with the blanket implementation. The trickery to deal with RelayEarly and Relay being the same type was not necessarily worth it; I will be separating them and removing said trickery in the next commit.
* tor-cell: documentation cleanups related to restricted_msgNick Mathewson2023-02-071-2/+2
|
* tor-cell: correct handling of optional msg types.Nick Mathewson2023-02-071-0/+5
| | | | | | We need to make sure any `#[cfg(feature=...)]` attributes are applied not only to our variant declarations, but also to the branches in the match statements that deal with them.
* tor-cell: Rename RelayMsg and RelayCell-related types.Nick Mathewson2023-02-071-4/+4
| | | | Thanks to rust-analyzer for making this simple.
* tor-cell: Rename ChanMsg and ChanCell-related types.Nick Mathewson2023-02-071-2/+2
|
* tor-cell: Macro to generate restricted RelayMsg and ChanMsg.Nick Mathewson2023-02-071-0/+196
This is the main implementation part of #525.