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>,
}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 = "...")]
Implementations§
Source§impl MethodInfo
impl MethodInfo
Sourcepub fn name_str(&self) -> String
pub fn name_str(&self) -> String
Method name as a protocol string, stripping the r# prefix from raw identifiers.
Use this instead of .name.to_string() whenever generating protocol-level names
(CLI subcommands, HTTP routes, JSON-RPC methods, OpenAPI operation IDs, etc.).
Raw identifiers like r#type must appear as "type" in protocols, not "r#type".
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