Running into a lifetime issue
This commit is contained in:
parent
2f515e068d
commit
efd103b84a
@ -1,6 +1,10 @@
|
||||
use crate::parser::KVPair;
|
||||
use crate::parser::RValue;
|
||||
use crate::parser::{Filter, RValue};
|
||||
use crate::renderer::context_element::ContextElement;
|
||||
use crate::renderer::Loopable;
|
||||
use crate::renderer::RenderError;
|
||||
use crate::renderer::Renderable;
|
||||
use crate::renderer::Walkable;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@ -25,4 +29,26 @@ impl<'a> ParametersContext<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
// impl<'a> ContextElement for ParametersContext<'a> {}
|
||||
impl<'a> ContextElement for ParametersContext<'a> {}
|
||||
|
||||
impl<'a> Renderable for ParametersContext<'a> {
|
||||
fn render(&self, _filters: &Vec<Filter>) -> Result<String, RenderError> {
|
||||
Ok("[object Object]".to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Loopable for ParametersContext<'a> {
|
||||
fn get_loop_elements(&self) -> Result<Vec<&dyn ContextElement>, RenderError> {
|
||||
Ok(vec![self])
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Walkable for ParametersContext<'a> {
|
||||
fn walk(&self, segment: &str) -> Result<&dyn ContextElement, RenderError> {
|
||||
// TODO: Actually implement
|
||||
Err(RenderError::CantWalk {
|
||||
segment: segment.to_string(),
|
||||
elem: self,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user