#[non_exhaustive]pub struct SourceFile {
pub path: RelPath,
pub package: String,
pub shipping: bool,
pub test: bool,
pub text: String,
pub reached: Vec<Reach>,
/* private fields */
}Expand description
A source file of the workspace, parsed once.
The facts the index is built from stay inside the crate; the items of a
file are read through Workspace::items_in and the other accessors.
The struct is #[non_exhaustive]: adding a field is not a breaking change,
so a pattern names the fields it reads and ends in ...
let raf_source::SourceFile { path, package, shipping, test, text, reached } = file;Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path: RelPathThe path, relative to the tree root.
package: StringThe name of the package of the first target that reaches the file.
shipping: boolTrue when some target that ships (library, binary, build script) reaches the file other than through test code.
test: boolTrue when every way of reaching the file goes through test code.
text: StringThe exact text that was parsed.
reached: Vec<Reach>Every way a module tree reaches the file, in the order the walk found them.
Implementations§
Source§impl SourceFile
impl SourceFile
Sourcepub fn reached_only_through_tests(&self) -> bool
pub fn reached_only_through_tests(&self) -> bool
True when every way of reaching the file goes through test code. The items of such a file are test code whatever their own attributes say.
Trait Implementations§
Source§impl Debug for SourceFile
impl Debug for SourceFile
impl Eq for SourceFile
Source§impl PartialEq for SourceFile
impl PartialEq for SourceFile
impl StructuralPartialEq for SourceFile
Auto Trait Implementations§
impl Forget for SourceFile
impl Freeze for SourceFile
impl Move for SourceFile
impl RefUnwindSafe for SourceFile
impl Send for SourceFile
impl Sync for SourceFile
impl Unpin for SourceFile
impl UnsafeUnpin for SourceFile
impl UnwindSafe for SourceFile
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> EvidenceLease for 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