pub struct ParsedTemplate {
pub path: String,
pub tokens: Vec<TemplateToken>,
pub variables_used: HashSet<String>,
pub functions_called: HashSet<String>,
pub defined_templates: HashSet<String>,
pub referenced_templates: HashSet<String>,
pub unclosed_blocks: Vec<(ControlStructure, u32)>,
pub errors: Vec<TemplateParseError>,
}Expand description
A parsed Go template with analysis data.
Fields§
§path: StringThe original file path.
tokens: Vec<TemplateToken>All tokens in the template.
variables_used: HashSet<String>All variables referenced (e.g., “.Values.image”, “.Release.Name”).
functions_called: HashSet<String>All functions called (e.g., “include”, “tpl”, “default”).
defined_templates: HashSet<String>Defined template names (from define/block).
referenced_templates: HashSet<String>Referenced template names (from template/include).
unclosed_blocks: Vec<(ControlStructure, u32)>Control structure stack tracking.
errors: Vec<TemplateParseError>Parse errors encountered.
Implementations§
Source§impl ParsedTemplate
impl ParsedTemplate
Sourcepub fn values_references(&self) -> Vec<&str>
pub fn values_references(&self) -> Vec<&str>
Get all .Values references.
Sourcepub fn release_references(&self) -> Vec<&str>
pub fn release_references(&self) -> Vec<&str>
Get all .Release references.
Sourcepub fn has_unclosed_blocks(&self) -> bool
pub fn has_unclosed_blocks(&self) -> bool
Check if the template has unclosed blocks.
Sourcepub fn calls_function(&self, name: &str) -> bool
pub fn calls_function(&self, name: &str) -> bool
Check if a function is called.
Sourcepub fn uses_lookup(&self) -> bool
pub fn uses_lookup(&self) -> bool
Check if the template uses lookup (requires K8s cluster).
Trait Implementations§
Source§impl Clone for ParsedTemplate
impl Clone for ParsedTemplate
Source§fn clone(&self) -> ParsedTemplate
fn clone(&self) -> ParsedTemplate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParsedTemplate
impl RefUnwindSafe for ParsedTemplate
impl Send for ParsedTemplate
impl Sync for ParsedTemplate
impl Unpin for ParsedTemplate
impl UnwindSafe for ParsedTemplate
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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 moreCreates a shared type from an unshared type.