pub struct TypeContext { /* private fields */ }Expand description
Context holding inferred types for all paths in values.yaml
Built by traversing the values.yaml structure and recording the type of each path. Used by the transformer to make smarter conversion decisions.
Implementations§
Source§impl TypeContext
impl TypeContext
Sourcepub fn from_value(value: &Value) -> Self
pub fn from_value(value: &Value) -> Self
Builds a type context from a parsed YAML value
Sourcepub fn get_type(&self, path: &str) -> InferredType
pub fn get_type(&self, path: &str) -> InferredType
Gets the inferred type for a path
The path can be in various formats:
"controller.containerPort"(plain)"values.controller.containerPort"(with values prefix)".Values.controller.containerPort"(Go template style)
All formats are normalized before lookup.
Sourcepub fn all_types(&self) -> impl Iterator<Item = (&str, InferredType)>
pub fn all_types(&self) -> impl Iterator<Item = (&str, InferredType)>
Returns all known paths and their types
Trait Implementations§
Source§impl Clone for TypeContext
impl Clone for TypeContext
Source§fn clone(&self) -> TypeContext
fn clone(&self) -> TypeContext
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 moreSource§impl Debug for TypeContext
impl Debug for TypeContext
Source§impl Default for TypeContext
impl Default for TypeContext
Source§fn default() -> TypeContext
fn default() -> TypeContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TypeContext
impl RefUnwindSafe for TypeContext
impl Send for TypeContext
impl Sync for TypeContext
impl Unpin for TypeContext
impl UnwindSafe for TypeContext
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