pub struct ClrBuilder { /* private fields */ }Expand description
CLR program builder that simplifies the construction of ClrProgram instances.
Implementations§
Source§impl ClrBuilder
impl ClrBuilder
Sourcepub fn add_external_assembly(&mut self, name: String)
pub fn add_external_assembly(&mut self, name: String)
Adds an external assembly reference to the program.
Sourcepub fn begin_class(&mut self, name: String, namespace: Option<String>)
pub fn begin_class(&mut self, name: String, namespace: Option<String>)
Begins a new class definition with the specified name and optional namespace.
Sourcepub fn begin_method(&mut self, name: String, return_type: ClrTypeReference)
pub fn begin_method(&mut self, name: String, return_type: ClrTypeReference)
Begins a new method definition with the specified name and return type.
Sourcepub fn emit(
&mut self,
opcode: ClrOpcode,
operand: Option<ClrInstructionOperand>,
)
pub fn emit( &mut self, opcode: ClrOpcode, operand: Option<ClrInstructionOperand>, )
Emits an instruction with the specified opcode and optional operand.
Sourcepub fn finish(self) -> ClrProgram
pub fn finish(self) -> ClrProgram
Finalizes the builder and returns the constructed ClrProgram.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClrBuilder
impl RefUnwindSafe for ClrBuilder
impl Send for ClrBuilder
impl Sync for ClrBuilder
impl Unpin for ClrBuilder
impl UnsafeUnpin for ClrBuilder
impl UnwindSafe for ClrBuilder
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