[][src]Struct dprint_core::Condition

pub struct Condition<TString = String, TInfo = Info> where
    TString: StringRef,
    TInfo: InfoRef
{ pub condition: Rc<Box<ConditionResolver<TString, TInfo, Condition<TString, TInfo>>>>, pub true_path: Option<Rc<Vec<PrintItem<TString, TInfo, Condition<TString, TInfo>>>>>, pub false_path: Option<Rc<Vec<PrintItem<TString, TInfo, Condition<TString, TInfo>>>>>, // 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

condition: Rc<Box<ConditionResolver<TString, TInfo, Condition<TString, TInfo>>>>

The condition to resolve.

true_path: Option<Rc<Vec<PrintItem<TString, TInfo, Condition<TString, TInfo>>>>>

The items to print when the condition is true.

false_path: Option<Rc<Vec<PrintItem<TString, TInfo, Condition<TString, TInfo>>>>>

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

Methods

impl<TString, TInfo> Condition<TString, TInfo> where
    TString: StringRef,
    TInfo: InfoRef
[src]

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

pub fn into_clone(&self) -> PrintItem<TString, TInfo, Condition<TString, TInfo>>[src]

Trait Implementations

impl<TString, TInfo> ConditionRef<TString, TInfo, Condition<TString, TInfo>> for Condition<TString, TInfo> where
    TString: StringRef,
    TInfo: InfoRef
[src]

impl<TString, TInfo> Into<PrintItem<TString, TInfo, Condition<TString, TInfo>>> for Condition<TString, TInfo> where
    TString: StringRef,
    TInfo: InfoRef
[src]

impl<TString, TInfo> Clone for Condition<TString, TInfo> where
    TString: StringRef,
    TInfo: InfoRef
[src]

Auto Trait Implementations

impl<TString = String, TInfo = Info> !Send for Condition<TString, TInfo>

impl<TString = String, TInfo = Info> !Sync for Condition<TString, TInfo>

impl<TString, TInfo> Unpin for Condition<TString, TInfo>

impl<TString = String, TInfo = Info> !UnwindSafe for Condition<TString, TInfo>

impl<TString = String, TInfo = Info> !RefUnwindSafe for Condition<TString, TInfo>

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]