pub struct ResolverContext {
pub config_path: String,
pub config_root: Option<Arc<Value>>,
pub base_path: Option<PathBuf>,
pub resolution_stack: Vec<String>,
}Expand description
Context provided to resolvers during resolution
Fields§
§config_path: StringThe path in the config where this resolution is happening
config_root: Option<Arc<Value>>The config root (for self-references)
base_path: Option<PathBuf>The base path for relative file paths
resolution_stack: Vec<String>Resolution stack for circular reference detection
Implementations§
Source§impl ResolverContext
impl ResolverContext
Sourcepub fn with_config_root(self, root: Arc<Value>) -> Self
pub fn with_config_root(self, root: Arc<Value>) -> Self
Set the config root for self-references
Sourcepub fn with_base_path(self, path: PathBuf) -> Self
pub fn with_base_path(self, path: PathBuf) -> Self
Set the base path for file resolution
Sourcepub fn would_cause_cycle(&self, path: &str) -> bool
pub fn would_cause_cycle(&self, path: &str) -> bool
Check if resolving a path would cause a circular reference
Sourcepub fn push_resolution(&mut self, path: &str)
pub fn push_resolution(&mut self, path: &str)
Push a path onto the resolution stack
Sourcepub fn pop_resolution(&mut self)
pub fn pop_resolution(&mut self)
Pop a path from the resolution stack
Sourcepub fn get_resolution_chain(&self) -> Vec<String>
pub fn get_resolution_chain(&self) -> Vec<String>
Get the resolution chain for error reporting
Trait Implementations§
Source§impl Clone for ResolverContext
impl Clone for ResolverContext
Source§fn clone(&self) -> ResolverContext
fn clone(&self) -> ResolverContext
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 ResolverContext
impl RefUnwindSafe for ResolverContext
impl Send for ResolverContext
impl Sync for ResolverContext
impl Unpin for ResolverContext
impl UnwindSafe for ResolverContext
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