pub struct CilMethod {
pub name: String,
pub params: Vec<(String, CilType)>,
pub return_type: CilType,
pub locals: Vec<CilLocal>,
pub instructions: Vec<CilInstr>,
pub is_static: bool,
pub is_virtual: bool,
pub is_abstract: bool,
pub visibility: CilVisibility,
pub max_stack: u32,
pub custom_attrs: Vec<String>,
}Expand description
A CIL method definition.
Fields§
§name: String§params: Vec<(String, CilType)>§return_type: CilType§locals: Vec<CilLocal>§instructions: Vec<CilInstr>§is_static: bool§is_virtual: bool§is_abstract: bool§visibility: CilVisibility§max_stack: u32§custom_attrs: Vec<String>Implementations§
Source§impl CilMethod
impl CilMethod
Sourcepub fn new_static(name: impl Into<String>, return_type: CilType) -> Self
pub fn new_static(name: impl Into<String>, return_type: CilType) -> Self
Create a new static method.
Sourcepub fn new_instance(name: impl Into<String>, return_type: CilType) -> Self
pub fn new_instance(name: impl Into<String>, return_type: CilType) -> Self
Create a new instance method.
Sourcepub fn add_param(&mut self, name: impl Into<String>, ty: CilType) -> u16
pub fn add_param(&mut self, name: impl Into<String>, ty: CilType) -> u16
Add a parameter and return its index.
Sourcepub fn add_local(&mut self, ty: CilType, name: Option<String>) -> u16
pub fn add_local(&mut self, ty: CilType, name: Option<String>) -> u16
Add a local variable and return its index.
Sourcepub fn emit_label(&mut self, label: impl Into<String>)
pub fn emit_label(&mut self, label: impl Into<String>)
Emit a label.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CilMethod
impl RefUnwindSafe for CilMethod
impl Send for CilMethod
impl Sync for CilMethod
impl Unpin for CilMethod
impl UnsafeUnpin for CilMethod
impl UnwindSafe for CilMethod
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