pub struct DiagnosticsExtractor { /* private fields */ }Expand description
Stateless, Send + Sync diagnostics extractor.
Each task execution gets one instance (shared between stdout and stderr
streams via Arc). All extracted issues receive the same marker and
source so they can be cleared together when the task reruns.
Implementations§
Source§impl DiagnosticsExtractor
impl DiagnosticsExtractor
Sourcepub fn new(marker: impl Into<String>, source: impl Into<String>) -> Self
pub fn new(marker: impl Into<String>, source: impl Into<String>) -> Self
Construct a new extractor.
marker— issue registry marker, usually"task:{queue}:{target}".source— human-readable tag for the registry (e.g."build").
Sourcepub fn extract_from_line(&self, line: &StyledLine) -> Vec<NewIssue>
pub fn extract_from_line(&self, line: &StyledLine) -> Vec<NewIssue>
Extract zero or more NewIssues from a single styled output line.
The plain text content of the line is used; ANSI styling is ignored.
Returns an empty Vec if the line matches no known pattern.
Sourcepub fn extract_from_str(&self, text: &str) -> Vec<NewIssue>
pub fn extract_from_str(&self, text: &str) -> Vec<NewIssue>
Extract zero or more NewIssues from a plain text line.
Equivalent to Self::extract_from_line but accepts a &str directly,
useful when the caller already has plain text (e.g. from a terminal PTY
output buffer where ANSI codes have already been stripped by the VT100
parser).
Sourcepub fn try_rustc_header(&self, text: &str) -> Option<(Severity, String)>
pub fn try_rustc_header(&self, text: &str) -> Option<(Severity, String)>
Try to match a rustc/cargo severity header line such as
error[E0425]: cannot find value \x`orwarning: unused variable`.
Returns (severity, message) if matched, None otherwise.
Auto Trait Implementations§
impl Freeze for DiagnosticsExtractor
impl RefUnwindSafe for DiagnosticsExtractor
impl Send for DiagnosticsExtractor
impl Sync for DiagnosticsExtractor
impl Unpin for DiagnosticsExtractor
impl UnsafeUnpin for DiagnosticsExtractor
impl UnwindSafe for DiagnosticsExtractor
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more