pub struct ClrMethod {
pub name: String,
pub return_type: ClrTypeReference,
pub parameters: Vec<ClrParameter>,
pub access_flags: ClrAccessFlags,
pub impl_flags: ClrMethodImplFlags,
pub instructions: Vec<ClrInstruction>,
pub max_stack: u16,
pub locals: Vec<ClrLocalVariable>,
pub exception_handlers: Vec<ClrExceptionHandler>,
pub attributes: Vec<ClrAttribute>,
pub is_entry_point: bool,
}Expand description
CLR 方法定义
Fields§
§name: String方法名称
return_type: ClrTypeReference返回类型
parameters: Vec<ClrParameter>参数列表
access_flags: ClrAccessFlags访问标志
impl_flags: ClrMethodImplFlags方法实现标志
instructions: Vec<ClrInstruction>指令列表
max_stack: u16最大栈深度
locals: Vec<ClrLocalVariable>局部变量
exception_handlers: Vec<ClrExceptionHandler>异常处理表
attributes: Vec<ClrAttribute>属性
is_entry_point: bool是否为入口点
Implementations§
Source§impl ClrMethod
impl ClrMethod
Sourcepub fn new(name: String, return_type: ClrTypeReference) -> Self
pub fn new(name: String, return_type: ClrTypeReference) -> Self
创建新的方法
Sourcepub fn add_instruction(&mut self, instruction: ClrInstruction)
pub fn add_instruction(&mut self, instruction: ClrInstruction)
添加指令
Sourcepub fn add_parameter(&mut self, parameter: ClrParameter)
pub fn add_parameter(&mut self, parameter: ClrParameter)
添加参数
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClrMethod
impl RefUnwindSafe for ClrMethod
impl Send for ClrMethod
impl Sync for ClrMethod
impl Unpin for ClrMethod
impl UnwindSafe for ClrMethod
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