pub struct Else<Before, After>(pub Before, pub After);Expand description
Represents “else” syntactically. Renders as Before else After.
This struct requires you to specify what comes before and after the else. For example:
let if_block = IfBlock(Str("true"), Str("log::info(\"Hello\")"));
let else_block = Block(Str("panic!()"));
let if_else = Else(if_block, else_block);
let string = InMemoryOutput::print_output(EmptyContext, &if_else);
assert_eq!("if true {\nlog::info(\"Hello\")\n} else {\npanic!()\n}", string)Tuple Fields§
§0: Before§1: AfterTrait Implementations§
Auto Trait Implementations§
impl<Before, After> Freeze for Else<Before, After>
impl<Before, After> RefUnwindSafe for Else<Before, After>where
Before: RefUnwindSafe,
After: RefUnwindSafe,
impl<Before, After> Send for Else<Before, After>
impl<Before, After> Sync for Else<Before, After>
impl<Before, After> Unpin for Else<Before, After>
impl<Before, After> UnwindSafe for Else<Before, After>where
Before: UnwindSafe,
After: UnwindSafe,
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