pub enum ValueKind<'ctx> {
Basic(BasicValueEnum<'ctx>),
Instruction(InstructionValue<'ctx>),
}Expand description
Either BasicValueEnum or InstructionValue.
Variants§
Basic(BasicValueEnum<'ctx>)
Represents a BasicValueEnum.
Instruction(InstructionValue<'ctx>)
Represents an InstructionValue.
Implementations§
Source§impl<'ctx> ValueKind<'ctx>
impl<'ctx> ValueKind<'ctx>
Sourcepub fn is_basic(self) -> bool
pub fn is_basic(self) -> bool
Determines if the ValueKind is a BasicValueEnum.
Sourcepub fn is_instruction(self) -> bool
pub fn is_instruction(self) -> bool
Determines if the ValueKind is an InstructionValue.
Sourcepub fn basic(self) -> Option<BasicValueEnum<'ctx>>
pub fn basic(self) -> Option<BasicValueEnum<'ctx>>
If the ValueKind is a BasicValueEnum, map it into Option::Some.
Sourcepub fn instruction(self) -> Option<InstructionValue<'ctx>>
pub fn instruction(self) -> Option<InstructionValue<'ctx>>
If the ValueKind is an InstructionValue, map it into Option::Some.
Sourcepub fn expect_basic(self, msg: &str) -> BasicValueEnum<'ctx>
pub fn expect_basic(self, msg: &str) -> BasicValueEnum<'ctx>
Expect BasicValueEnum, panic with the message if it is not.
Sourcepub fn expect_instruction(self, msg: &str) -> InstructionValue<'ctx>
pub fn expect_instruction(self, msg: &str) -> InstructionValue<'ctx>
Expect InstructionValue, panic with the message if it is not.
Sourcepub fn unwrap_basic(self) -> BasicValueEnum<'ctx>
pub fn unwrap_basic(self) -> BasicValueEnum<'ctx>
Unwrap BasicValueEnum. Will panic if it is not.
Sourcepub fn unwrap_instruction(self) -> InstructionValue<'ctx>
pub fn unwrap_instruction(self) -> InstructionValue<'ctx>
Unwrap InstructionValue. Will panic if it is not.
Trait Implementations§
impl<'ctx> Copy for ValueKind<'ctx>
impl<'ctx> Eq for ValueKind<'ctx>
impl<'ctx> StructuralPartialEq for ValueKind<'ctx>
Auto Trait Implementations§
impl<'ctx> Freeze for ValueKind<'ctx>
impl<'ctx> RefUnwindSafe for ValueKind<'ctx>
impl<'ctx> !Send for ValueKind<'ctx>
impl<'ctx> !Sync for ValueKind<'ctx>
impl<'ctx> Unpin for ValueKind<'ctx>
impl<'ctx> UnsafeUnpin for ValueKind<'ctx>
impl<'ctx> UnwindSafe for ValueKind<'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