pub enum Operand<'ctx> {
Value(BasicValueEnum<'ctx>),
Block(BasicBlock<'ctx>),
}Expand description
Either BasicValueEnum or BasicBlock.
Variants§
Value(BasicValueEnum<'ctx>)
Represents a BasicValueEnum.
Block(BasicBlock<'ctx>)
Represents a BasicBlock.
Implementations§
Source§impl<'ctx> Operand<'ctx>
impl<'ctx> Operand<'ctx>
Sourcepub fn is_value(self) -> bool
pub fn is_value(self) -> bool
Determines if the Operand is a BasicValueEnum.
Sourcepub fn is_block(self) -> bool
pub fn is_block(self) -> bool
Determines if the Operand is a BasicBlock.
Sourcepub fn value(self) -> Option<BasicValueEnum<'ctx>>
pub fn value(self) -> Option<BasicValueEnum<'ctx>>
If the Operand is a BasicValueEnum, map it into Option::Some.
Sourcepub fn block(self) -> Option<BasicBlock<'ctx>>
pub fn block(self) -> Option<BasicBlock<'ctx>>
If the Operand is a BasicBlock, map it into Option::Some.
Sourcepub fn expect_value(self, msg: &str) -> BasicValueEnum<'ctx>
pub fn expect_value(self, msg: &str) -> BasicValueEnum<'ctx>
Expect BasicValueEnum, panic with the message if it is not.
Sourcepub fn expect_block(self, msg: &str) -> BasicBlock<'ctx>
pub fn expect_block(self, msg: &str) -> BasicBlock<'ctx>
Expect BasicBlock, panic with the message if it is not.
Sourcepub fn unwrap_value(self) -> BasicValueEnum<'ctx>
pub fn unwrap_value(self) -> BasicValueEnum<'ctx>
Unwrap BasicValueEnum. Will panic if it is not.
Sourcepub fn unwrap_block(self) -> BasicBlock<'ctx>
pub fn unwrap_block(self) -> BasicBlock<'ctx>
Unwrap BasicBlock. Will panic if it is not.
Trait Implementations§
impl<'ctx> Copy for Operand<'ctx>
impl<'ctx> Eq for Operand<'ctx>
impl<'ctx> StructuralPartialEq for Operand<'ctx>
Auto Trait Implementations§
impl<'ctx> Freeze for Operand<'ctx>
impl<'ctx> RefUnwindSafe for Operand<'ctx>
impl<'ctx> !Send for Operand<'ctx>
impl<'ctx> !Sync for Operand<'ctx>
impl<'ctx> Unpin for Operand<'ctx>
impl<'ctx> UnsafeUnpin for Operand<'ctx>
impl<'ctx> UnwindSafe for Operand<'ctx>
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