pub(crate) fn navigate<'reg, 'rc>(
        &'rc self,
        relative_path: &[PathSeg],
        block_contexts: &VecDeque<BlockContext<'reg>>,
    ) -> Result<ScopedJson<'reg, 'rc>, RenderError> {
        // always use absolute at the moment until we get base_value lifetime issue fixed
        let resolved_visitor = parse_json_visitor(relative_path, block_contexts, true);

        // debug logging
        debug!("Accessing context value: {:?}", resolved_visitor);

        match resolved_visitor {
            ResolvedPath::AbsolutePath(paths) => {
                let mut ptr = Some(self.data());
                for p in paths.iter() {
                    ptr = get_data(ptr, p)?;
                }

                Ok(ptr
                    .map(|v| ScopedJson::Context(v, paths))
                    .unwrap_or_else(|| ScopedJson::Missing))
            }
            ResolvedPath::RelativePath(_paths) => {
                // relative path is disabled for now
                unreachable!()
                // let mut ptr = block_contexts.front().and_then(|blk| blk.base_value());
                // for p in paths.iter() {
                //     ptr = get_data(ptr, p)?;
                // }

                // Ok(ptr
                //     .map(|v| ScopedJson::Context(v, paths))
                //     .unwrap_or_else(|| ScopedJson::Missing))
            }
            ResolvedPath::BlockParamValue(paths, value)
            | ResolvedPath::LocalValue(paths, value) => {
                let mut ptr = Some(value);
                for p in paths.iter() {
                    ptr = get_data(ptr, p)?;
                }
                Ok(ptr
                    .map(|v| ScopedJson::Derived(v.clone()))
                    .unwrap_or_else(|| ScopedJson::Missing))
            }
        }
    }
/// Navigate the context with relative path and block scopes
Navigate the context with relative path and block scopes
Navigate the context with relative path and block scopes
pub(crate) fn navigate<'reg, 'rc>(
        &'rc self,
        relative_path: &[PathSeg],
        block_contexts: &VecDeque<BlockContext<'reg>>,
    ) -> Result<ScopedJson<'reg, 'rc>, RenderError> {
        // always use absolute at the moment until we get base_value lifetime issue fixed
        let resolved_visitor = parse_json_visitor(relative_path, block_contexts, true);
        // debug logging
        debug!("Accessing context value: {:?}", resolved_visitor);
        match resolved_visitor {
            ResolvedPath::AbsolutePath(paths) => {
                let mut ptr = Some(self.data());
                for p in paths.iter() {
                    ptr = get_data(ptr, p)?;
                }
                Ok(ptr
                    .map(|v| ScopedJson::Context(v, paths))
                    .unwrap_or_else(|| ScopedJson::Missing))
            }
            ResolvedPath::RelativePath(_paths) => {
                // relative path is disabled for now
                unreachable!()
                // let mut ptr = block_contexts.front().and_then(|blk| blk.base_value());
                // for p in paths.iter() {
                //     ptr = get_data(ptr, p)?;
                // }
                // Ok(ptr
                //     .map(|v| ScopedJson::Context(v, paths))
                //     .unwrap_or_else(|| ScopedJson::Missing))
            }
            ResolvedPath::BlockParamValue(paths, value)
            | ResolvedPath::LocalValue(paths, value) => {
                let mut ptr = Some(value);
                for p in paths.iter() {
                    ptr = get_data(ptr, p)?;
                }
                Ok(ptr
                    .map(|v| ScopedJson::Derived(v.clone()))
                    .unwrap_or_else(|| ScopedJson::Missing))
            }
        }
    }
pub ( crate ) fn navigate < ' reg , ' rc > ( & ' rc self , relative_path : & [ PathSeg ] , block_contexts : & VecDeque < BlockContext < ' reg > > , ) -> Result < ScopedJson < ' reg , ' rc > , RenderError > { // always use absolute at the moment until we get base_value lifetime issue fixed let resolved_visitor = parse_json_visitor ( relative_path , block_contexts , true ) ; // debug logging debug ! ( " " resolved_visitor ) ; match resolved_visitor { ResolvedPath :: AbsolutePath ( paths ) => { let mut ptr = Some ( self . data ( ) ) ; for p in paths . iter ( ) { ptr = get_data ( ptr , p ) ? ; } Ok ( ptr . map ( | v | ScopedJson :: Context ( v , paths ) ) . unwrap_or_else ( | | ScopedJson :: Missing ) ) } ResolvedPath :: RelativePath ( _paths ) => { // relative path is disabled for now unreachable ! ( ) // let mut ptr = block_contexts.front().and_then(|blk| blk.base_value()); // for p in paths.iter() { //     ptr = get_data(ptr, p)?; // } // Ok(ptr //     .map(|v| ScopedJson::Context(v, paths)) //     .unwrap_or_else(|| ScopedJson::Missing)) } ResolvedPath :: BlockParamValue ( paths , value ) | ResolvedPath :: LocalValue ( paths , value ) => { let mut ptr = Some ( value ) ; for p in paths . iter ( ) { ptr = get_data ( ptr , p ) ? ; } Ok ( ptr . map ( | v | ScopedJson :: Derived ( v . clone ( ) ) ) . unwrap_or_else ( | | ScopedJson :: Missing ) ) } } }
Navigate the context with relative path and block scopes
Navigate the context with relative path and block scopes
&'rc self
relative_path
&[PathSeg]
block_contexts
&VecDeque<BlockContext<'reg>>
&'rc self
relative_path
&[PathSeg]
block_contexts
&VecDeque<BlockContext<'reg>>