[][src]Struct dprint_core::Condition

pub struct Condition {
    pub name: &'static str,
    pub condition: Rc<Box<ConditionResolver>>,
    pub true_path: Option<Rc<Vec<PrintItem>>>,
    pub false_path: Option<Rc<Vec<PrintItem>>>,
    // some fields omitted
}

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.

Fields

name: &'static str

Name for debugging purposes.

condition: Rc<Box<ConditionResolver>>

The condition to resolve.

true_path: Option<Rc<Vec<PrintItem>>>

The items to print when the condition is true.

false_path: Option<Rc<Vec<PrintItem>>>

The items to print when the condition is false or undefined (not yet resolved).

Methods

impl Condition[src]

pub fn new(name: &'static str, properties: ConditionProperties) -> Condition[src]

pub fn get_unique_id(&self) -> usize[src]

pub fn to_item(self) -> PrintItem[src]

pub fn to_item_clone(&self) -> PrintItem[src]

Trait Implementations

impl Clone for Condition[src]

Auto Trait Implementations

impl !Send for Condition

impl !Sync for Condition

impl Unpin for Condition

impl !UnwindSafe for Condition

impl !RefUnwindSafe for Condition

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]