#[repr(i32)]pub enum Direction {
Unspecified = 0,
Request = 1,
Response = 2,
Tell = 3,
}Expand description
Direction of an RpcEnvelope on the wire.
Receivers route explicitly on this field instead of inferring request-vs-response from pending-state or tell-ness from timeout_ms. Routing policy: REQUEST and TELL are dispatched to a handler; RESPONSE wakes the matching pending request. Absence, DIRECTION_UNSPECIFIED, and unknown future values are invalid on the current wire protocol; receivers should warn and drop instead of guessing from local pending state.
Senders MUST set this on every envelope they construct.
Receivers trust this label without cross-checking pending state, so a mislabeled envelope is routed by its label: a request stamped Response is dropped if its request_id isn’t pending, and a response stamped Request is enqueued as a new call. The orphan-drop log includes route_key to make such mislabels diagnosable.
Variants§
Unspecified = 0
Invalid default / missing direction sentinel; receivers warn + drop
Request = 1
A new RPC call addressed to a handler; a response is expected
Response = 2
A reply (success payload or ErrorResponse) to a prior request
Tell = 3
Fire-and-forget request; receiver MUST NOT reply
Implementations§
Source§impl Direction
impl Direction
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.