pub struct CommandMetadata {
pub name: &'static str,
pub id: u16,
pub invoke: ShimFn,
pub args_schema: SchemaFn,
pub ret_schema: SchemaFn,
pub arg_names: &'static str,
}Expand description
Static metadata for a single registered RPC command.
Populated by the #[command] macro at compile time and collected into
TELEPATH_COMMANDS via linkme distributed slices.
Fields§
§name: &'static strHuman-readable function name (used for discovery).
id: u16Command ID: hash of (name + input schema + output schema). Computed at firmware build time for deterministic matching.
invoke: ShimFnType-erased shim that deserializes args, calls the function, and serializes the result.
args_schema: SchemaFnWrites the postcard-encoded args-tuple NamedType schema into the
provided buffer. Returns the byte count written.
ret_schema: SchemaFnWrites the postcard-encoded return-type NamedType schema into the
provided buffer. Returns the byte count written.
arg_names: &'static strComma-separated argument names, e.g. "a,b" for fn foo(a: i32, b: i32).
Empty string for zero-argument commands.
Trait Implementations§
Source§impl Clone for CommandMetadata
impl Clone for CommandMetadata
Source§fn clone(&self) -> CommandMetadata
fn clone(&self) -> CommandMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more