pub struct Condition<'a> { /* private fields */ }Expand description
Conditionally print items based on a condition.
These conditions are extremely flexible and can even be resolved based on information found later on in the file.
Implementations§
Source§impl<'a> Condition<'a>
impl<'a> Condition<'a>
pub fn new(name: &'static str, properties: ConditionProperties<'a>) -> Self
pub fn new_true() -> Self
pub fn new_false() -> Self
pub fn unique_id(&self) -> u32
pub fn name(&self) -> &'static str
pub fn true_path(&self) -> &Option<PrintItemPath<'a>>
pub fn false_path(&self) -> &Option<PrintItemPath<'a>>
pub fn create_reference(&mut self) -> ConditionReference
pub fn create_reevaluation(&mut self) -> ConditionReevaluation
Sourcepub fn set_unknown_same_as_false(&mut self)
pub fn set_unknown_same_as_false(&mut self)
Says that what’s printed when the condition isn’t resolved yet is the same as when it’s false, including by the conditions using its value. When it looked ahead and turns out to be false, the printer then doesn’t go back to print the same thing again.
This is only needed when the condition has a reference, since the printer already doesn’t go back to a condition without one when it takes the same path as before.
Trait Implementations§
Source§impl<'a> IntoPrintItems<'a> for Condition<'a>
impl<'a> IntoPrintItems<'a> for Condition<'a>
fn into_print_items(self, arena: &'a Arena) -> PrintItems<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Condition<'a>
impl<'a> !Send for Condition<'a>
impl<'a> !Sync for Condition<'a>
impl<'a> !UnwindSafe for Condition<'a>
impl<'a> Forget for Condition<'a>
impl<'a> Freeze for Condition<'a>
impl<'a> Unpin for Condition<'a>
impl<'a> UnsafeUnpin for Condition<'a>
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