pub struct BuildInfo {
pub version: String,
pub compiler_version: String,
pub root_files: Vec<String>,
pub file_infos: BTreeMap<String, FileInfo>,
pub dependencies: BTreeMap<String, Vec<String>>,
pub semantic_diagnostics_per_file: BTreeMap<String, Vec<CachedDiagnostic>>,
pub emit_signatures: BTreeMap<String, EmitSignature>,
pub latest_changed_dts_file: Option<String>,
pub options: BuildInfoOptions,
pub build_time: u64,
}Expand description
Build information persisted between compilations
Fields§
§version: StringVersion of the build info format
compiler_version: StringCompiler version that created this build info
root_files: Vec<String>Root files that were compiled
file_infos: BTreeMap<String, FileInfo>Information about each compiled file
dependencies: BTreeMap<String, Vec<String>>Dependency graph: file -> files it imports
semantic_diagnostics_per_file: BTreeMap<String, Vec<CachedDiagnostic>>Semantic diagnostics for files (cached from previous builds)
emit_signatures: BTreeMap<String, EmitSignature>Emit output signatures (for output file caching)
latest_changed_dts_file: Option<String>Path to the most recently changed .d.ts file Used by project references for fast invalidation checking
options: BuildInfoOptionsOptions that affect compilation
build_time: u64Timestamp of when the build was completed
Implementations§
Source§impl BuildInfo
impl BuildInfo
Sourcepub fn load(path: &Path) -> Result<Option<Self>>
pub fn load(path: &Path) -> Result<Option<Self>>
Load build info from a file
Returns Ok(None) if the file exists but is incompatible (version mismatch)
Returns Ok(Some(build_info)) if the file is valid and compatible
Sourcepub fn set_file_info(&mut self, path: &str, info: FileInfo)
pub fn set_file_info(&mut self, path: &str, info: FileInfo)
Add or update file info
Sourcepub fn get_file_info(&self, path: &str) -> Option<&FileInfo>
pub fn get_file_info(&self, path: &str) -> Option<&FileInfo>
Get file info
Sourcepub fn set_dependencies(&mut self, path: &str, deps: Vec<String>)
pub fn set_dependencies(&mut self, path: &str, deps: Vec<String>)
Set dependencies for a file
Sourcepub fn get_dependencies(&self, path: &str) -> Option<&[String]>
pub fn get_dependencies(&self, path: &str) -> Option<&[String]>
Get dependencies for a file
Sourcepub fn set_emit_signature(&mut self, path: &str, signature: EmitSignature)
pub fn set_emit_signature(&mut self, path: &str, signature: EmitSignature)
Set emit signature for a file
Sourcepub fn has_file_changed(&self, path: &str, current_version: &str) -> bool
pub fn has_file_changed(&self, path: &str, current_version: &str) -> bool
Check if a file has changed since last build
Sourcepub fn get_dependents(&self, path: &str) -> Vec<String>
pub fn get_dependents(&self, path: &str) -> Vec<String>
Get all files that depend on a given file
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BuildInfo
impl<'de> Deserialize<'de> for BuildInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for BuildInfo
impl RefUnwindSafe for BuildInfo
impl Send for BuildInfo
impl Sync for BuildInfo
impl Unpin for BuildInfo
impl UnsafeUnpin for BuildInfo
impl UnwindSafe for BuildInfo
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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