pub struct MsilMethodBody {
pub maxstack: Option<u32>,
pub locals: Vec<MsilLocal>,
pub instructions: Vec<MsilInstruction>,
}Expand description
MSIL 方法体定义
包含方法的实现细节,如最大栈大小、局部变量和指令序列。
§示例
use clr_msil::ast::{MsilInstruction, MsilLocal, MsilMethodBody};
let body = MsilMethodBody {
maxstack: Some(8),
locals: vec![MsilLocal {
index: Some(0),
local_type: "bool".to_string(),
name: Some("V_0".to_string()),
}],
instructions: vec![MsilInstruction {
opcode: "ldstr".to_string(),
operands: vec!["Hello World!".to_string()],
label: None,
}],
};Fields§
§maxstack: Option<u32>最大栈大小
locals: Vec<MsilLocal>局部变量列表
instructions: Vec<MsilInstruction>指令序列
Trait Implementations§
Source§impl Clone for MsilMethodBody
impl Clone for MsilMethodBody
Source§fn clone(&self) -> MsilMethodBody
fn clone(&self) -> MsilMethodBody
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 MsilMethodBody
impl RefUnwindSafe for MsilMethodBody
impl Send for MsilMethodBody
impl Sync for MsilMethodBody
impl Unpin for MsilMethodBody
impl UnwindSafe for MsilMethodBody
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