pub struct TypewriterConfig {
pub typescript: Option<TypeScriptConfig>,
pub python: Option<PythonConfig>,
pub go: Option<GoConfig>,
pub swift: Option<SwiftConfig>,
pub kotlin: Option<KotlinConfig>,
}Expand description
Top-level configuration from typewriter.toml.
Fields§
§typescript: Option<TypeScriptConfig>TypeScript emitter configuration
python: Option<PythonConfig>Python emitter configuration
go: Option<GoConfig>Go emitter configuration
swift: Option<SwiftConfig>Swift emitter configuration
kotlin: Option<KotlinConfig>Kotlin emitter configuration
Implementations§
Source§impl TypewriterConfig
impl TypewriterConfig
Sourcepub fn load(project_root: &Path) -> Result<TypewriterConfig, Error>
pub fn load(project_root: &Path) -> Result<TypewriterConfig, Error>
Load configuration from a typewriter.toml file.
Returns Ok(default) if the file doesn’t exist (all fields optional).
Returns Err if the file exists but is malformed.
Sourcepub fn ts_output_dir(&self) -> &str
pub fn ts_output_dir(&self) -> &str
Get the TypeScript output directory, with a default fallback.
Sourcepub fn py_output_dir(&self) -> &str
pub fn py_output_dir(&self) -> &str
Get the Python output directory, with a default fallback.
Sourcepub fn ts_readonly(&self) -> bool
pub fn ts_readonly(&self) -> bool
Check if TypeScript readonly mode is enabled.
Sourcepub fn ts_file_style(&self) -> Option<FileStyle>
pub fn ts_file_style(&self) -> Option<FileStyle>
Get the TypeScript file naming style.
Returns the parsed FileStyle from config, or None to use the emitter’s default.
Sourcepub fn py_file_style(&self) -> Option<FileStyle>
pub fn py_file_style(&self) -> Option<FileStyle>
Get the Python file naming style.
Returns the parsed FileStyle from config, or None to use the emitter’s default.
Sourcepub fn go_output_dir(&self) -> &str
pub fn go_output_dir(&self) -> &str
Get the Go output directory, with a default fallback.
Sourcepub fn go_file_style(&self) -> Option<FileStyle>
pub fn go_file_style(&self) -> Option<FileStyle>
Get the Go file naming style.
Returns the parsed FileStyle from config, or None to use the emitter’s default.
Sourcepub fn go_package_name(&self) -> &str
pub fn go_package_name(&self) -> &str
Get the Go package name.
Sourcepub fn swift_output_dir(&self) -> &str
pub fn swift_output_dir(&self) -> &str
Get the Swift output directory, with a default fallback.
Sourcepub fn swift_file_style(&self) -> Option<FileStyle>
pub fn swift_file_style(&self) -> Option<FileStyle>
Get the Swift file naming style.
Sourcepub fn kotlin_output_dir(&self) -> &str
pub fn kotlin_output_dir(&self) -> &str
Get the Kotlin output directory, with a default fallback.
Sourcepub fn kotlin_file_style(&self) -> Option<FileStyle>
pub fn kotlin_file_style(&self) -> Option<FileStyle>
Get the Kotlin file naming style.
Sourcepub fn kotlin_package_name(&self) -> &str
pub fn kotlin_package_name(&self) -> &str
Get the Kotlin package name.
Trait Implementations§
Source§impl Clone for TypewriterConfig
impl Clone for TypewriterConfig
Source§fn clone(&self) -> TypewriterConfig
fn clone(&self) -> TypewriterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more