Skip to main content

Out

Struct Out 

Source
pub struct Out {
    pub json: bool,
    /* private fields */
}
Expand description

Where a diagnostic goes once the run has decided to say it: printed as it comes (text) or kept for the document (json) — or, under --statistics, neither, since the table it asked for is the tally alone.

Which diagnostics a run says, and in what words, is the library’s (htl::project::Sink) — a dependency’s error is said once per run, and a replayed entry comes through the same decisions a fresh check does. What is left here is the part that is genuinely a command line’s: how a finding reads on a terminal.

Fields§

§json: bool

Implementations§

Source§

impl Out

Source

pub fn new(json: bool, statistics_only: bool) -> Self

Source

pub fn take(&mut self) -> Vec<Diagnostic>

Source

pub fn rules_said(&self) -> impl Iterator<Item = &str>

The rules the findings said so far were under, each once, in name order: what htl check names --explain for after the findings. [NO_RULE] is a key of the tally, not a rule, and is skipped here.

Source

pub fn statistics(&self) -> Vec<RuleStatistic>

One row per rule with at least one finding, count descending then rule ascending — ruff --statistics’s shape. A rule with no finding this run is not a key of the tally at all, so it is never a row.

Trait Implementations§

Source§

impl Output for Out

Source§

fn diagnostic(&mut self, d: &Diagnostic)

Take one diagnostic the run has decided to say. Its fix is what htl fix would apply; its required_by and origin are set when the finding is in a module this project required rather than in the project, which is what lets a caller file it differently without reading the path.

Auto Trait Implementations§

§

impl Freeze for Out

§

impl RefUnwindSafe for Out

§

impl Send for Out

§

impl Sync for Out

§

impl Unpin for Out

§

impl UnsafeUnpin for Out

§

impl UnwindSafe for Out

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeSend for T

Source§

impl<T> MaybeSync for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.