pub struct CompileCx<'a> { /* private fields */ }Expand description
Compiles config fields, recording each issue at its exact authored path.
Implementations§
Source§impl<'a> CompileCx<'a>
impl<'a> CompileCx<'a>
Sourcepub fn new(exprs: &'a ExprEngine, issues: &'a mut Vec<Issue>) -> Self
pub fn new(exprs: &'a ExprEngine, issues: &'a mut Vec<Issue>) -> Self
A context rooted at the document itself.
Sourcepub fn at_path(self, path: AuthoredPath) -> Self
pub fn at_path(self, path: AuthoredPath) -> Self
Roots the walk at path; a field is the first key below it.
Sourcepub fn for_step(self, kind: StepKind, id: impl Into<String>) -> Self
pub fn for_step(self, kind: StepKind, id: impl Into<String>) -> Self
Stamps the step on every issue.
Sourcepub fn with_runtime_fields(self, fields: &'a [FieldSpec]) -> Self
pub fn with_runtime_fields(self, fields: &'a [FieldSpec]) -> Self
The fields a plugin declared at runtime.
Sourcepub fn exprs(&self) -> &ExprEngine
pub fn exprs(&self) -> &ExprEngine
The engine expressions compile with.
Sourcepub fn path(&self) -> &AuthoredPath
pub fn path(&self) -> &AuthoredPath
The current path.
Sourcepub fn runtime_fields(&self) -> Option<&'a [FieldSpec]>
pub fn runtime_fields(&self) -> Option<&'a [FieldSpec]>
The runtime-declared fields, if any.
Sourcepub fn issue(&mut self, code: IssueCode, message: impl Into<String>)
pub fn issue(&mut self, code: IssueCode, message: impl Into<String>)
Records an issue at the current path, at the code’s default severity.
Sourcepub fn issue_as(
&mut self,
code: IssueCode,
severity: Severity,
message: impl Into<String>,
)
pub fn issue_as( &mut self, code: IssueCode, severity: Severity, message: impl Into<String>, )
Records an issue at the current path with an explicit severity.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CompileCx<'a>
impl<'a> !UnwindSafe for CompileCx<'a>
impl<'a> Freeze for CompileCx<'a>
impl<'a> Send for CompileCx<'a>
impl<'a> Sync for CompileCx<'a>
impl<'a> Unpin for CompileCx<'a>
impl<'a> UnsafeUnpin for CompileCx<'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