pub struct SourceFacts { /* private fields */ }Expand description
The facts of one file text that the check compares.
Implementations§
Source§impl SourceFacts
impl SourceFacts
Sourcepub fn collect(path: &Path, source: &str) -> Option<Self>
pub fn collect(path: &Path, source: &str) -> Option<Self>
The facts of source, the text of the file at path. None for a
file type that the engine does not parse here, or for a text with a
parse error.
Sourcepub fn exports(&self) -> &FxHashSet<String>
pub fn exports(&self) -> &FxHashSet<String>
Each name that the text exports. A default export has the name
default.
Sourcepub fn check(
&self,
path: &Path,
after: &str,
deleted: &[(u32, u32)],
) -> Result<Self, PostEditViolation>
pub fn check( &self, path: &Path, after: &str, deleted: &[(u32, u32)], ) -> Result<Self, PostEditViolation>
Check after, the edited text of the file at path. deleted holds
the byte ranges of the deletions in the text before the edit. A member
or a declaration inside one of these ranges may go; each other member
must stay.
§Errors
The first violation that the check finds.
Sourcepub fn check_edits(
&self,
path: &Path,
source: &str,
edits: &[SpanEdit],
removable: impl Fn(&str) -> bool,
) -> Result<(), PostEditViolation>
pub fn check_edits( &self, path: &Path, source: &str, edits: &[SpanEdit], removable: impl Fn(&str) -> bool, ) -> Result<(), PostEditViolation>
Check edits of source, the text that these facts describe. See
check_edits.
§Errors
The first violation that the check finds.
Trait Implementations§
Source§impl Debug for SourceFacts
impl Debug for SourceFacts
Auto Trait Implementations§
impl Forget for SourceFacts
impl Freeze for SourceFacts
impl Move for SourceFacts
impl RefUnwindSafe for SourceFacts
impl Send for SourceFacts
impl Sync for SourceFacts
impl Unpin for SourceFacts
impl UnsafeUnpin for SourceFacts
impl UnwindSafe for SourceFacts
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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 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> ⓘ
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