Class RustOutputManager

java.lang.Object
uk.co.real_logic.sbe.generation.rust.RustOutputManager
All Implemented Interfaces:
OutputManager

public class RustOutputManager extends Object implements OutputManager
OutputManager for managing the creation of Rust source files as the target of code generation. The character encoding for the Writer is UTF-8.
  • Constructor Details

    • RustOutputManager

      public RustOutputManager(String baseDirName, String packageName)
      Create a new OutputManager for generating rust source files into a given module.
      Parameters:
      baseDirName - for the generated source code.
      packageName - for the generated source code relative to the baseDirName.
  • Method Details

    • createOutput

      public Writer createOutput(String name) throws IOException
      Create a new output which will be a rust source file in the given module.

      The Writer should be closed once the caller has finished with it. The Writer is buffered for efficient IO operations.

      Specified by:
      createOutput in interface OutputManager
      Parameters:
      name - the name of the rust struct.
      Returns:
      a Writer to which the source code should be written.
      Throws:
      IOException - if an issue occurs when creating the file.
    • createCargoToml

      public Writer createCargoToml() throws IOException
      Creates a new Cargo.toml file.

      Returns:
      a Writer to which the crate definition should be written.
      Throws:
      IOException - if an issue occurs when creating the file.