pub struct Validator<'a> { /* private fields */ }Expand description
AST validator that checks for issues before execution.
Implementations§
Source§impl<'a> Validator<'a>
impl<'a> Validator<'a>
Sourcepub fn new(
registry: &'a ToolRegistry,
user_tools: &'a HashMap<String, ToolDef>,
catalog: &'a [ToolSchema],
) -> Self
pub fn new( registry: &'a ToolRegistry, user_tools: &'a HashMap<String, ToolDef>, catalog: &'a [ToolSchema], ) -> Self
Create a new validator.
catalog is the kernel’s name-sorted Arc<[ToolSchema]> (see
ExecContext::tool_schemas); pass &[] when none is available.
Sourcepub fn validate(self, program: &Program) -> Vec<ValidationIssue>
pub fn validate(self, program: &Program) -> Vec<ValidationIssue>
Validate a program and return all issues found.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Validator<'a>
impl<'a> !UnwindSafe for Validator<'a>
impl<'a> Freeze for Validator<'a>
impl<'a> Send for Validator<'a>
impl<'a> Sync for Validator<'a>
impl<'a> Unpin for Validator<'a>
impl<'a> UnsafeUnpin for Validator<'a>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Pointable for T
impl<T> Pointable for T
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.