pub struct StoredFileFacts {
pub not_text: bool,
pub type_ref_names: BTreeSet<String>,
pub js: Option<StoredJsFacts>,
pub rust: Option<StoredRustFacts>,
pub go: Option<GoDispatchFacts>,
}Expand description
What dead-code analysis reads from one file’s syntax tree, recorded once per content when the data layer parses the file, so an analysis reads it from the file’s content record instead of parsing again.
Records are shared by every path with the same content, so nothing here
depends on the file’s path: what does (the files of out-of-line modules,
a Go file’s module) is completed for each path by
StoredFileFacts::into_analysis.
Fields§
§not_text: boolThe source is not UTF-8 text, so analysis reads nothing from it.
type_ref_names: BTreeSet<String>§js: Option<StoredJsFacts>§rust: Option<StoredRustFacts>§go: Option<GoDispatchFacts>A Go file’s dispatch facts, without its module.
Implementations§
Source§impl StoredFileFacts
impl StoredFileFacts
Sourcepub fn encode_for_record(source: &[u8], lang: LangId, tree: &Tree) -> Vec<u8> ⓘ
pub fn encode_for_record(source: &[u8], lang: LangId, tree: &Tree) -> Vec<u8> ⓘ
The facts of source in lang, encoded for a content record:
source as stored (the bytes of the file) and tree, the tree the
data layer parsed it to.
Sourcepub fn extract(source: &str, lang: LangId, tree: Option<&Tree>) -> Self
pub fn extract(source: &str, lang: LangId, tree: Option<&Tree>) -> Self
The facts of source in lang, from tree, its syntax tree (None
when parsing failed).
Sourcepub fn into_analysis(
self,
lang: LangId,
file: &Path,
relative_file: &str,
has_oxc_file: bool,
) -> FileAnalysis
pub fn into_analysis( self, lang: LangId, file: &Path, relative_file: &str, has_oxc_file: bool, ) -> FileAnalysis
The analysis of the file at file (relative_file from the project
root), whose language is lang, from its facts. has_oxc_file says
the Oxc engine has facts for it, which replace its raw imports and
re-exports.
Trait Implementations§
Source§impl Debug for StoredFileFacts
impl Debug for StoredFileFacts
Source§impl Default for StoredFileFacts
impl Default for StoredFileFacts
Source§impl<'de> Deserialize<'de> for StoredFileFacts
impl<'de> Deserialize<'de> for StoredFileFacts
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 Forget for StoredFileFacts
impl Freeze for StoredFileFacts
impl Move for StoredFileFacts
impl RefUnwindSafe for StoredFileFacts
impl Send for StoredFileFacts
impl Sync for StoredFileFacts
impl Unpin for StoredFileFacts
impl UnsafeUnpin for StoredFileFacts
impl UnwindSafe for StoredFileFacts
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> 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