pub enum RelayCommand {
Show 16 variants
Begin = 1,
Data = 2,
End = 3,
Connected = 4,
SendMe = 5,
Extend = 6,
Extended = 7,
Truncate = 8,
Truncated = 9,
Drop = 10,
Resolve = 11,
Resolved = 12,
BeginDir = 13,
Extend2 = 14,
Extended2 = 15,
Unknown = 16,
}Expand description
Relay cell command types.
Commands used within relay cells to manage streams and circuits. These commands have two characteristics:
- Direction: Forward commands originate from the client; backward commands come from the relay.
- Scope: Stream commands affect individual streams; circuit commands affect the entire circuit.
§Variants
| Command | Value | Direction | Scope | Description |
|---|---|---|---|---|
Begin | 1 | Forward | Stream | Begin a new stream |
Data | 2 | Forward/Backward | Stream | Transmit data |
End | 3 | Forward/Backward | Stream | End a stream |
Connected | 4 | Backward | Stream | Reply to BEGIN |
SendMe | 5 | Forward/Backward | Both | Flow control acknowledgment |
Extend | 6 | Forward | Circuit | Extend circuit (legacy) |
Extended | 7 | Backward | Circuit | Reply to EXTEND |
Truncate | 8 | Forward | Circuit | Remove last hop |
Truncated | 9 | Backward | Circuit | Reply to TRUNCATE |
Drop | 10 | Forward/Backward | Circuit | Ignorable no-op |
Resolve | 11 | Forward | Stream | DNS resolution request |
Resolved | 12 | Backward | Stream | Reply to RESOLVE |
BeginDir | 13 | Forward | Stream | Request directory info |
Extend2 | 14 | Forward | Circuit | Extend circuit (ntor) |
Extended2 | 15 | Backward | Circuit | Reply to EXTEND2 |
Unknown | - | - | - | Unrecognized command |
§Example
use stem_rs::client::datatype::RelayCommand;
let (cmd, raw) = RelayCommand::get(1);
assert_eq!(cmd, RelayCommand::Begin);
assert_eq!(format!("{}", cmd), "RELAY_BEGIN");Variants§
Begin = 1
Begin a new stream (forward, stream).
Data = 2
Transmit data (forward/backward, stream).
End = 3
End a stream (forward/backward, stream).
Connected = 4
Reply to BEGIN (backward, stream).
SendMe = 5
Flow control - ready for more cells (forward/backward, stream/circuit).
Extend = 6
Extend circuit through another relay - legacy (forward, circuit).
Extended = 7
Reply to EXTEND (backward, circuit).
Truncate = 8
Remove last circuit hop (forward, circuit).
Truncated = 9
Reply to TRUNCATE (backward, circuit).
Drop = 10
Ignorable no-op (forward/backward, circuit).
Resolve = 11
Request DNS resolution (forward, stream).
Resolved = 12
Reply to RESOLVE (backward, stream).
BeginDir = 13
Request directory information (forward, stream).
Extend2 = 14
Extend circuit - ntor handshake (forward, circuit).
Extended2 = 15
Reply to EXTEND2 (backward, circuit).
Unknown = 16
Unrecognized command.
Implementations§
Source§impl RelayCommand
impl RelayCommand
Sourcepub fn get(val: u8) -> (RelayCommand, u8)
pub fn get(val: u8) -> (RelayCommand, u8)
Trait Implementations§
Source§impl Clone for RelayCommand
impl Clone for RelayCommand
Source§fn clone(&self) -> RelayCommand
fn clone(&self) -> RelayCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more