pub struct SwitchTargets {
pub branches: Vec<(u128, BasicBlockId)>,
pub otherwise: BasicBlockId,
}Expand description
Switch targets for conditional branches
Fields§
§branches: Vec<(u128, BasicBlockId)>(value, target) pairs
otherwise: BasicBlockIdDefault target (if no branch matches)
Implementations§
Source§impl SwitchTargets
impl SwitchTargets
Sourcepub fn if_else(then_block: BasicBlockId, else_block: BasicBlockId) -> Self
pub fn if_else(then_block: BasicBlockId, else_block: BasicBlockId) -> Self
Create a simple if-else (true -> then_block, false -> else_block)
Sourcepub fn new(branches: Vec<(u128, BasicBlockId)>, otherwise: BasicBlockId) -> Self
pub fn new(branches: Vec<(u128, BasicBlockId)>, otherwise: BasicBlockId) -> Self
Create switch with multiple branches
Trait Implementations§
Source§impl Clone for SwitchTargets
impl Clone for SwitchTargets
Source§fn clone(&self) -> SwitchTargets
fn clone(&self) -> SwitchTargets
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SwitchTargets
impl RefUnwindSafe for SwitchTargets
impl Send for SwitchTargets
impl Sync for SwitchTargets
impl Unpin for SwitchTargets
impl UnwindSafe for SwitchTargets
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