pub struct Parser<F: EvalContextFamily> { /* private fields */ }Expand description
OTTL Parser that parses input strings and produces executable objects. Paths are resolved at parse time (not at execution time) for maximum performance.
The type parameter F is the EvalContextFamily that determines the concrete
evaluation context type used at execution time.
Implementations§
Source§impl<F: EvalContextFamily> Parser<F>
impl<F: EvalContextFamily> Parser<F>
Sourcepub fn new(
editors_map: &CallbackMap,
converters_map: &CallbackMap,
enums_map: &EnumMap,
path_resolvers: &PathResolverMap<F>,
expression: &str,
) -> Self
pub fn new( editors_map: &CallbackMap, converters_map: &CallbackMap, enums_map: &EnumMap, path_resolvers: &PathResolverMap<F>, expression: &str, ) -> Self
Creates a new parser with the given configuration.
Each path that appears in the expression must have a corresponding entry in path_resolvers;
otherwise parsing fails with an error.
Trait Implementations§
Source§impl<F: EvalContextFamily> OttlParser<F> for Parser<F>
Implementation of the OttlParser trait for Parser.
impl<F: EvalContextFamily> OttlParser<F> for Parser<F>
Implementation of the OttlParser trait for Parser.
Auto Trait Implementations§
impl<F> Freeze for Parser<F>
impl<F> !RefUnwindSafe for Parser<F>
impl<F> Send for Parser<F>where
F: Send,
impl<F> Sync for Parser<F>where
F: Sync,
impl<F> Unpin for Parser<F>where
F: Unpin,
impl<F> UnsafeUnpin for Parser<F>
impl<F> !UnwindSafe for Parser<F>
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, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.