pub struct MethodInfo {
pub method: ImplItemFn,
pub name: Ident,
pub docs: Option<String>,
pub params: Vec<ParamInfo>,
pub return_info: ReturnInfo,
pub is_async: bool,
pub group: Option<String>,
pub wire_name: Option<String>,
}Expand description
Parsed method information with full syn AST types.
This is the rich, compile-time representation used by all proc macros
during code generation. It retains full syn::Type and syn::Ident
nodes for accurate token generation.
Not to be confused with [server_less_core::MethodInfo], which is
a simplified, string-based representation for runtime introspection.
Fields§
§method: ImplItemFnThe original method
name: IdentMethod name
docs: Option<String>Documentation string
params: Vec<ParamInfo>Parameters (excluding self)
return_info: ReturnInfoReturn type info
is_async: boolWhether the method is async
group: Option<String>Group assignment from #[server(group = "...")]
wire_name: Option<String>Explicit wire name override from #[server(name = "...")] or protocol-specific
#[cli(name = "...")], #[mcp(name = "...")], etc.
Implementations§
Source§impl MethodInfo
impl MethodInfo
Sourcepub fn name_str(&self) -> String
pub fn name_str(&self) -> String
Rust method name with r# prefix stripped.
Returns the raw identifier name, ignoring any wire_name override.
Use this for code generation (self.method_name()) and as the base for
protocol-specific transforms (.to_kebab_case(), .to_snake_case(), etc.).
Sourcepub fn wire_name_or(&self, transform: impl FnOnce(String) -> String) -> String
pub fn wire_name_or(&self, transform: impl FnOnce(String) -> String) -> String
Protocol-facing name, applying a transform to the raw name unless overridden.
If wire_name is set (from #[server(name = "...")] or protocol-specific
attributes), returns it as-is. Otherwise applies transform to the raw name.
// CLI: kebab-case
method.wire_name_or(|n| n.to_kebab_case())
// JSON-RPC: raw name
method.wire_name_or(|n| n)
// gRPC: snake_case
method.wire_name_or(|n| n.to_snake_case())Source§impl MethodInfo
impl MethodInfo
Sourcepub fn parse(method: &ImplItemFn) -> Result<Option<Self>>
pub fn parse(method: &ImplItemFn) -> Result<Option<Self>>
Parse a method from an ImplItemFn
Returns None for associated functions without &self (constructors, etc.)
Trait Implementations§
Source§impl Clone for MethodInfo
impl Clone for MethodInfo
Source§fn clone(&self) -> MethodInfo
fn clone(&self) -> MethodInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more