pub struct OpDescriptor {
pub op_id: &'static str,
pub kind: OpKind,
pub input_ty: &'static str,
pub output_ty: &'static str,
pub idempotent_by_default: bool,
pub auth_required: bool,
}Expand description
Wire-shape of a single op in a transport rpc schema. See
docs/design/rpc-transport.md for the full design — in short, an
op is the dispatch unit shared by every RPC binding (HTTP unary,
HTTP batch, HTTP stream, WebSocket). The macro emits one
OpDescriptor per CRUD verb and per procedure when
Schema.transport == TransportStyle::Rpc.
REST schemas continue to emit RouteTransportDescriptor instead;
nothing emits both.
Fields§
§op_id: &'static strStable dotted id, e.g. "model.User.list" or
"procedure.publishPost". This is the only dispatch key —
same string appears in URLs (POST /rpc/:op_id), in
batch/WS Request.op fields, and in generated client SDK
call sites.
kind: OpKind§input_ty: &'static strSchema-level name of the input type (e.g. "PublishPostInput").
Empty string when the op takes no input.
output_ty: &'static strSchema-level name of the output type. Empty string when the
op returns nothing (e.g. delete with no echo).
idempotent_by_default: boolWhether the op can be safely retried without an idempotency key. True for reads and pure procedures; false for mutations.
auth_required: boolTrait Implementations§
Source§impl Clone for OpDescriptor
impl Clone for OpDescriptor
Source§fn clone(&self) -> OpDescriptor
fn clone(&self) -> OpDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more