Struct dprint_core::formatting::ConditionResolverContext
source · [−]pub struct ConditionResolverContext<'a, 'b> {
pub writer_info: WriterInfo,
/* private fields */
}Expand description
Context used when resolving a condition.
Fields
writer_info: WriterInfoGets the writer info at the condition’s location.
Implementations
sourceimpl<'a, 'b> ConditionResolverContext<'a, 'b>
impl<'a, 'b> ConditionResolverContext<'a, 'b>
sourcepub fn get_resolved_condition(
&mut self,
condition_reference: &ConditionReference
) -> Option<bool>
pub fn get_resolved_condition(
&mut self,
condition_reference: &ConditionReference
) -> Option<bool>
Gets if a condition was true, false, or returns undefined when not yet resolved.
A condition reference can be retrieved by calling the get_reference() on a condition.
sourcepub fn get_resolved_info(&self, info: &Info) -> Option<&WriterInfo>
pub fn get_resolved_info(&self, info: &Info) -> Option<&WriterInfo>
Gets the writer info at a specified info or returns undefined when not yet resolved.
sourcepub fn clear_info(&mut self, info: &Info)
pub fn clear_info(&mut self, info: &Info)
Clears the info result from being stored.
sourcepub fn has_info_moved(&mut self, info: &Info) -> Option<bool>
pub fn has_info_moved(&mut self, info: &Info) -> Option<bool>
Gets if the provided info has moved positions since the last check. Returns None when the info can’t be resolved. Returns Some(false) the first time this is called.
Auto Trait Implementations
impl<'a, 'b> !RefUnwindSafe for ConditionResolverContext<'a, 'b>
impl<'a, 'b> !Send for ConditionResolverContext<'a, 'b>
impl<'a, 'b> !Sync for ConditionResolverContext<'a, 'b>
impl<'a, 'b> Unpin for ConditionResolverContext<'a, 'b> where
'b: 'a,
impl<'a, 'b> !UnwindSafe for ConditionResolverContext<'a, 'b>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more