pub struct Builder { /* private fields */ }Expand description
Builder for constructing Diagnostic instances.
All methods are builder-pattern (consume and return Self).
Call build to finalize into an immutable Diagnostic.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn span(self, spans: impl MultiSpan) -> Self
pub fn span(self, spans: impl MultiSpan) -> Self
Sets the source span(s). Accepts a Span, Vec<Span>, or &[Span].
Sourcepub fn add(self, child: impl Into<Builder>) -> Self
pub fn add(self, child: impl Into<Builder>) -> Self
Adds a child diagnostic. Accepts a Builder (built automatically)
or a Diagnostic (via Into<Builder>).
Sourcepub fn build(self) -> Diagnostic
pub fn build(self) -> Diagnostic
Finalizes the builder into an immutable Diagnostic.
Trait Implementations§
Source§impl From<Diagnostic> for Builder
impl From<Diagnostic> for Builder
Source§fn from(d: Diagnostic) -> Self
fn from(d: Diagnostic) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl !Send for Builder
impl !Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl UnwindSafe for Builder
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