[−][src]Struct dprint_core::Condition
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<PrintItemPath<TString, TInfo, Condition<TString, TInfo>>>
The items to print when the condition is true.
false_path: Option<PrintItemPath<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: StringTrait,
TInfo: InfoTrait,
[src]
TString: StringTrait,
TInfo: InfoTrait,
pub fn new(
name: &'static str,
properties: ConditionProperties<TString, TInfo>
) -> Condition<TString, TInfo>
[src]
name: &'static str,
properties: ConditionProperties<TString, TInfo>
) -> Condition<TString, TInfo>
pub fn new_true() -> Condition<TString, TInfo>
[src]
pub fn new_false() -> Condition<TString, TInfo>
[src]
pub fn new_with_dependent_infos(
name: &'static str,
properties: ConditionProperties<TString, TInfo>,
dependent_infos: Vec<TInfo>
) -> Condition<TString, TInfo>
[src]
name: &'static str,
properties: ConditionProperties<TString, TInfo>,
dependent_infos: Vec<TInfo>
) -> Condition<TString, TInfo>
pub fn get_reference(&mut self) -> ConditionReference
[src]
Trait Implementations
impl Clone for Condition
[src]
impl<TString, TInfo> ConditionTrait<TString, TInfo, Condition<TString, TInfo>> for Condition<TString, TInfo> where
TString: StringTrait,
TInfo: InfoTrait,
[src]
TString: StringTrait,
TInfo: InfoTrait,
fn get_unique_id(&self) -> usize
[src]
fn get_name(&self) -> &'static str
[src]
fn get_is_stored(&self) -> bool
[src]
fn resolve(
&self,
context: &mut ConditionResolverContext<TString, TInfo, Self>
) -> Option<bool>
[src]
&self,
context: &mut ConditionResolverContext<TString, TInfo, Self>
) -> Option<bool>
fn get_true_path(
&self
) -> Option<PrintItemPath<TString, TInfo, Condition<TString, TInfo>>>
[src]
&self
) -> Option<PrintItemPath<TString, TInfo, Condition<TString, TInfo>>>
fn get_false_path(
&self
) -> Option<PrintItemPath<TString, TInfo, Condition<TString, TInfo>>>
[src]
&self
) -> Option<PrintItemPath<TString, TInfo, Condition<TString, TInfo>>>
fn get_dependent_infos<'a>(&'a self) -> &'a Option<Vec<TInfo>>
[src]
impl Into<PrintItems<String, Info, Condition<String, Info>>> for Condition
[src]
fn into(self) -> PrintItems
[src]
Auto Trait Implementations
impl<TString = String, TInfo = Info> !RefUnwindSafe for Condition<TString, TInfo>
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> where
TInfo: Unpin,
TInfo: Unpin,
impl<TString = String, TInfo = Info> !UnwindSafe for Condition<TString, TInfo>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,