pub struct VarExpander { /* private fields */ }Expand description
@acp:summary “Expands variable references with caching”
Implementations§
Source§impl VarExpander
impl VarExpander
Sourcepub fn new(resolver: VarResolver) -> Self
pub fn new(resolver: VarResolver) -> Self
Create a new expander from a resolver
Sourcepub fn expand_var(
&mut self,
name: &str,
max_depth: usize,
visited: &mut HashSet<String>,
) -> Option<String>
pub fn expand_var( &mut self, name: &str, max_depth: usize, visited: &mut HashSet<String>, ) -> Option<String>
Expand a single variable
Sourcepub fn expand_text(
&mut self,
text: &str,
mode: ExpansionMode,
) -> ExpansionResult
pub fn expand_text( &mut self, text: &str, mode: ExpansionMode, ) -> ExpansionResult
Expand all variable references in text
Sourcepub fn get_inheritance_chain(&self, name: &str) -> InheritanceChain
pub fn get_inheritance_chain(&self, name: &str) -> InheritanceChain
Get inheritance chain for a variable by traversing refs
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the expansion cache
Auto Trait Implementations§
impl Freeze for VarExpander
impl RefUnwindSafe for VarExpander
impl Send for VarExpander
impl Sync for VarExpander
impl Unpin for VarExpander
impl UnwindSafe for VarExpander
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more