Skip to main content

Module

Struct Module 

Source
pub struct Module {
    pub diagnostics: Vec<Recorded>,
    pub errors: usize,
    pub warnings: usize,
    pub lints: usize,
    pub deps: Vec<String>,
    pub requires: Vec<RequireJson>,
    pub code: Option<String>,
    pub check: Option<CheckInfoJson>,
}
Expand description

What checking one module reported.

Fields§

§diagnostics: Vec<Recorded>

Its diagnostics, its contract lints included, in the order they were printed.

§errors: usize

How many of diagnostics were errors, counted when the entry was written.

Stored rather than recounted on replay: the three are what a run adds up to decide its exit code, and a replay that recounted them would be deciding that from its own reading of the severity strings instead of from what the original run concluded.

§warnings: usize

Warnings, as errors.

§lints: usize

Lints, as errors.

§deps: Vec<String>

What the checker resolved this module’s requires to. The next run keys on these, which is how a dependency’s edit invalidates its dependents.

§requires: Vec<RequireJson>

Every require in the source and where it went, which deps is the resolved, deduplicated half of. Kept whole because the cycle lint reports a call site, and a path cannot say which line asked for it.

§code: Option<String>

The Lua this module generates, for entries under gen_key. htl check never needs it and stores None; htl test stores it so a replay can go straight to running. Absent when checking produced errors, since there is nothing to run then.

§check: Option<CheckInfoJson>

What checking reported, in the form the test runner needs it back.

htl check replays diagnostics straight into the sink and never reconstructs a CheckInfo; the test runner puts one into its report, so a replayed test file needs the structured form rather than the printed one. Only gen_key entries carry it.

Implementations§

Source§

impl Module

Source

pub fn requires_only(&self) -> CheckInfo

A CheckInfo carrying only what the project-level lints read.

require_cycles runs over every file in the walk, replayed ones included — a cycle that closes through a module nobody edited is still a cycle — so a replayed module has to produce something that lint can read. Its diagnostics are already printed by then, and nothing downstream looks at the other fields.

Source

pub fn generated(c: &CheckInfo, code: String) -> Self

A gen entry as the linker and the test runner write it: no printed diagnostics (they print from the structured form), the generated Lua, and what the check said.

Trait Implementations§

Source§

impl Clone for Module

Source§

fn clone(&self) -> Module

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Module

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Module

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Module

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.