pub struct Linked {
pub modules: Vec<LinkedModule>,
pub host_modules: Vec<String>,
pub errors: Vec<String>,
pub link_errors: Vec<Diagnostic>,
pub lints: Vec<String>,
pub checks: Vec<(PathBuf, CheckInfo)>,
pub cached: usize,
/* private fields */
}Expand description
The result of a link: the bundle, and everything a reporter wants to say about how it was arrived at.
The bundle is private because an incomplete one must not escape — see
errors and bundle. link itself returns Ok
with the errors inside, so a caller (a build.rs, the macros) can show the whole list
rather than the first one; the bundle is handed out only when the list is empty.
Fields§
§modules: Vec<LinkedModule>Every module the walk took, in the order it took them.
host_modules: Vec<String>Names the host is expected to provide at run time, so the bundle records them as its own requirements rather than carrying code for them.
errors: Vec<String>Type errors and unresolved requires. A module with a type error is absent from
the bundle, so the bundle is only handed out (bundle) when this
is empty: a program missing a module dies at its first require, far from here.
Each is a Diagnostic’s text with its path spelled as
htl check spells it (spelled), so the error a
failed include_bundle! or into_bundle shows names a file the way the report does.
link_errors: Vec<Diagnostic>The part of errors the linker found itself — a require nothing
answers, an extra module that is not there, a name two files claim — as values.
The rest of errors is the modules’ own checks, which checks
carries. A reporter says these after the checks’ diagnostics; it does not have to
tell the two apart by their text.
lints: Vec<String>Lints from every module, which do not stop a bundle: whether they stop the run
is the caller’s, and the caller is what knows about strict.
checks: Vec<(PathBuf, CheckInfo)>The full check of each module, for a reader that wants more than the flattened
errors and lints — the requires, the
dependencies, the per-file verdict.
cached: usizeHow many typed modules came from the store rather than the checker. Zero without
a store. The total to say it against is the typed count of modules.
Implementations§
Source§impl Linked
impl Linked
Sourcepub fn reported(&self, path: &Path, check: &CheckInfo) -> CheckInfo
pub fn reported(&self, path: &Path, check: &CheckInfo) -> CheckInfo
The check of path as a report says it: check without the errors a linker error
at the same place says instead (link_errors). The checks in
checks are left as the checker made them.
Sourcepub fn into_bundle(self) -> Result<Bundle>
pub fn into_bundle(self) -> Result<Bundle>
The bundle by value, on the same condition as bundle: for a
caller that writes it out and is done with the report around it.
Sourcepub fn inputs(&self) -> Vec<PathBuf>
pub fn inputs(&self) -> Vec<PathBuf>
Every file the bundle was built from (entry, modules, and what the checker read
for them, e.g. .d.tls): what a build script or macro should watch for changes,
one cargo:rerun-if-changed=<file> each. Files, not the directory: cargo compares
the mtime of the path it is given, and editing a file inside a directory does not
change the directory’s.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Linked
impl RefUnwindSafe for Linked
impl Send for Linked
impl Sync for Linked
impl Unpin for Linked
impl UnsafeUnpin for Linked
impl UnwindSafe for Linked
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> 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