pub struct RustWriter {
pub output_dir: PathBuf,
}Expand description
Generates Rust source files from ScannedModule instances.
For each module, a .rs stub file is written under output_dir, with the
module-id dot-separated path converted to a directory hierarchy
(users.get_user → users/get_user.rs).
This writer provides structural parity with PythonWriter (Python SDK)
and TypeScriptWriter (TypeScript SDK). The generated files are
starting-point stubs; callers are expected to fill in the todo! bodies.
Fields§
§output_dir: PathBufRoot directory under which stub .rs files are written.
Implementations§
Source§impl RustWriter
impl RustWriter
Sourcepub fn new(output_dir: impl Into<PathBuf>) -> Self
pub fn new(output_dir: impl Into<PathBuf>) -> Self
Create a new RustWriter targeting output_dir.
Sourcepub fn write(
&self,
modules: &[ScannedModule],
) -> Result<Vec<WriteResult>, WriteError>
pub fn write( &self, modules: &[ScannedModule], ) -> Result<Vec<WriteResult>, WriteError>
Write Rust stub files for each ScannedModule.
Returns one WriteResult per module. I/O errors short-circuit with
Err(WriteError).
Auto Trait Implementations§
impl Freeze for RustWriter
impl RefUnwindSafe for RustWriter
impl Send for RustWriter
impl Sync for RustWriter
impl Unpin for RustWriter
impl UnsafeUnpin for RustWriter
impl UnwindSafe for RustWriter
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