pub struct SourceExtractionSession { /* private fields */ }Expand description
Reusable state for extracting multiple definition sources in one analysis run.
Reusing a session shares bounded parser and module-resolution work across files. Create one session per analysis root rather than sharing it between unrelated repositories.
Implementations§
Source§impl SourceExtractionSession
impl SourceExtractionSession
Sourcepub fn with_dependencies(self, dependencies: &[SourceDependency]) -> Self
pub fn with_dependencies(self, dependencies: &[SourceDependency]) -> Self
Supplies resolved loading edges from discovery without executing dependencies.
Sourcepub fn finalize(
&mut self,
files: &[SourceFile],
definitions: &mut Vec<StepDefinition>,
) -> Result<SourceFinalization>
pub fn finalize( &mut self, files: &[SourceFile], definitions: &mut Vec<StepDefinition>, ) -> Result<SourceFinalization>
Finalizes all selected frontends after extraction and applies cross-file trust effects.
Call this before analyzing accumulated definitions. A later source can invalidate an earlier registration; individual extraction results are provisional until this operation.
Sourcepub fn with_dependency_gaps(self, gaps: &[DependencyGap]) -> Self
pub fn with_dependency_gaps(self, gaps: &[DependencyGap]) -> Self
Supplies loading calls that discovery refused to follow, so their diagnostics name the cause.
Sourcepub fn new(root: &Path) -> Self
pub fn new(root: &Path) -> Self
Creates an extraction session whose imported modules must remain inside root.
Sourcepub fn with_registrations(root: &Path, registrations: &[String]) -> Self
pub fn with_registrations(root: &Path, registrations: &[String]) -> Self
Creates a session that also treats registrations as step-registration function names.
Use this for project-declared wrappers that static inference cannot recognize, such as a helper that builds its registration call dynamically.
Sourcepub fn with_options(
root: &Path,
registrations: &[String],
assertion_modules: &[String],
) -> Self
pub fn with_options( root: &Path, registrations: &[String], assertion_modules: &[String], ) -> Self
Creates a session that also trusts assertion_modules as assertion-factory providers.
Use this for a local module that re-exports expect from a supported assertion package, or
for a runner this build does not recognize by name. Without it such a factory is untrusted
and its expected values are not treated as behaviour.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SourceExtractionSession
impl RefUnwindSafe for SourceExtractionSession
impl Send for SourceExtractionSession
impl Sync for SourceExtractionSession
impl Unpin for SourceExtractionSession
impl UnsafeUnpin for SourceExtractionSession
impl UnwindSafe for SourceExtractionSession
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