pub struct TypewriterConfig {
pub typescript: Option<TypeScriptConfig>,
pub python: Option<PythonConfig>,
}Expand description
Re-export core types for advanced usage.
Top-level configuration from typewriter.toml.
Fields§
§typescript: Option<TypeScriptConfig>TypeScript emitter configuration
python: Option<PythonConfig>Python 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.
Trait Implementations§
Source§impl Clone for TypewriterConfig
impl Clone for TypewriterConfig
Source§fn clone(&self) -> TypewriterConfig
fn clone(&self) -> TypewriterConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypewriterConfig
impl Debug for TypewriterConfig
Source§impl Default for TypewriterConfig
impl Default for TypewriterConfig
Source§fn default() -> TypewriterConfig
fn default() -> TypewriterConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TypewriterConfig
impl<'de> Deserialize<'de> for TypewriterConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TypewriterConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TypewriterConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TypewriterConfig
impl RefUnwindSafe for TypewriterConfig
impl Send for TypewriterConfig
impl Sync for TypewriterConfig
impl Unpin for TypewriterConfig
impl UnsafeUnpin for TypewriterConfig
impl UnwindSafe for TypewriterConfig
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