pub struct SourceDumper<G: SourceGenerator> { /* private fields */ }Expand description
Type-safe source dumper that enforces generator usage.
This struct ensures that source generation always goes through a SourceGenerator,
preventing bugs where mod declarations are missing.
§Type Safety
By requiring a SourceGenerator at construction time, we guarantee that:
- Empty modules are handled correctly
- Module hierarchy is properly derived
mod xxx;declarations are generated
§Example
ⓘ
use ryo_executor::engine::{SourceDumper, RegistryGenerator};
// Create dumper with generator (type-enforced)
let dumper = SourceDumper::new(RegistryGenerator::multi_file());
// Dump all files (generator is automatically invoked)
let files = dumper.dump_all(&ctx);Implementations§
Source§impl<G: SourceGenerator> SourceDumper<G>
impl<G: SourceGenerator> SourceDumper<G>
Sourcepub fn dump_all(
&self,
ctx: &AnalysisContext,
) -> Result<HashMap<WorkspaceFilePath, String>, ToSynError>
pub fn dump_all( &self, ctx: &AnalysisContext, ) -> Result<HashMap<WorkspaceFilePath, String>, ToSynError>
Generate and dump all files from the analysis context.
This method:
- Invokes the generator to create
GeneratedWorkspace - Converts crate-relative paths to
WorkspaceFilePath - Returns the final file map
§Path Conversion
Crate-relative paths (e.g., "src/lib.rs") are converted to
workspace-relative paths (e.g., "crates/core/src/lib.rs") by:
- Finding existing files for each crate to determine crate_root
- Combining crate_root + crate-relative path
Auto Trait Implementations§
impl<G> Freeze for SourceDumper<G>where
G: Freeze,
impl<G> RefUnwindSafe for SourceDumper<G>where
G: RefUnwindSafe,
impl<G> Send for SourceDumper<G>where
G: Send,
impl<G> Sync for SourceDumper<G>where
G: Sync,
impl<G> Unpin for SourceDumper<G>where
G: Unpin,
impl<G> UnsafeUnpin for SourceDumper<G>where
G: UnsafeUnpin,
impl<G> UnwindSafe for SourceDumper<G>where
G: UnwindSafe,
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
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