pub struct MsilMethod {
pub modifiers: Vec<String>,
pub return_type: String,
pub name: String,
pub parameters: Vec<MsilParameter>,
pub body: Option<MsilMethodBody>,
}Expand description
MSIL 方法定义
表示一个 MSIL 方法,包含方法签名和方法体。
§示例
use clr_msil::ast::{MsilMethod, MsilMethodBody, MsilParameter};
let method = MsilMethod {
modifiers: vec!["public".to_string(), "static".to_string()],
return_type: "void".to_string(),
name: "Main".to_string(),
parameters: vec![MsilParameter {
param_type: "string[]".to_string(),
name: Some("args".to_string()),
}],
body: None,
};Fields§
§modifiers: Vec<String>方法修饰符(如 public, static, virtual 等)
return_type: String返回类型
name: String方法名
parameters: Vec<MsilParameter>方法参数列表
body: Option<MsilMethodBody>方法体(包含指令和局部变量)
Trait Implementations§
Source§impl Clone for MsilMethod
impl Clone for MsilMethod
Source§fn clone(&self) -> MsilMethod
fn clone(&self) -> MsilMethod
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MsilMethod
impl RefUnwindSafe for MsilMethod
impl Send for MsilMethod
impl Sync for MsilMethod
impl Unpin for MsilMethod
impl UnwindSafe for MsilMethod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more