Struct precis_tools::RustCodeGen
source · pub struct RustCodeGen { /* private fields */ }
Expand description
This is the main code generator element. It aggregates other
CodeGen
elements. The resulting file will contain the
code generated by every element added to the code generator.
Implementations§
source§impl RustCodeGen
impl RustCodeGen
sourcepub fn new<P>(filename: P) -> Result<Self, Error>
pub fn new<P>(filename: P) -> Result<Self, Error>
Creates a new Rust code generator
§Arguments:
filename
- The file name
§Returns:
This method returns a new RustCodeGen
instance if no errors
occurs when the file is created
sourcepub fn generate_code(&mut self) -> Result<(), Error>
pub fn generate_code(&mut self) -> Result<(), Error>
Write the code into the file created on construction. In case of error, the file generated could stay in an incomplete or inconsistent state.
Auto Trait Implementations§
impl Freeze for RustCodeGen
impl !RefUnwindSafe for RustCodeGen
impl !Send for RustCodeGen
impl !Sync for RustCodeGen
impl Unpin for RustCodeGen
impl !UnwindSafe for RustCodeGen
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