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: u32,
pub locals: Vec<ClrLocalVariable>,
pub exception_handlers: Vec<ClrExceptionHandler>,
pub attributes: Vec<ClrAttribute>,
pub is_entry_point: bool,
}Expand description
CLR method definition representing a method in a type.
Fields§
§name: StringThe name of the method.
return_type: ClrTypeReferenceThe return type of the method.
parameters: Vec<ClrParameter>The parameters of the method.
access_flags: ClrAccessFlagsAccess flags for the method.
impl_flags: ClrMethodImplFlagsImplementation flags for the method.
instructions: Vec<ClrInstruction>The IL instructions in the method body.
max_stack: u32The maximum stack depth for the method.
locals: Vec<ClrLocalVariable>Local variables defined in the method.
exception_handlers: Vec<ClrExceptionHandler>Exception handlers defined in the method.
attributes: Vec<ClrAttribute>Custom attributes applied to this method.
is_entry_point: boolWhether this method is the assembly entry point.
Implementations§
Source§impl ClrMethod
impl ClrMethod
Sourcepub fn new(name: String, return_type: ClrTypeReference) -> Self
pub fn new(name: String, return_type: ClrTypeReference) -> Self
Creates a new method with the specified name and return type.
Sourcepub fn add_instruction(&mut self, instruction: ClrInstruction)
pub fn add_instruction(&mut self, instruction: ClrInstruction)
Adds an instruction to the method body.
Sourcepub fn add_parameter(&mut self, parameter: ClrParameter)
pub fn add_parameter(&mut self, parameter: ClrParameter)
Adds a parameter to the method.
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 UnsafeUnpin 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