pub struct Config { /* private fields */ }Expand description
Configuration for Flow type generation.
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Read config from environment variables.
| Variable | Default |
|---|---|
FLOW_RS_EXPORT_DIR | ./bindings |
FLOW_RS_FILE_EXTENSION | js.flow |
FLOW_RS_LARGE_INT | bigint |
Sourcepub fn with_out_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_out_dir(self, dir: impl Into<PathBuf>) -> Self
Set the export directory.
Sourcepub fn with_array_tuple_limit(self, limit: usize) -> Self
pub fn with_array_tuple_limit(self, limit: usize) -> Self
Set the maximum size of arrays up to which they are treated as Flow tuples.
Arrays beyond this size will instead result in a $ReadOnlyArray<T>.
Default: 64
Sourcepub fn array_tuple_limit(&self) -> usize
pub fn array_tuple_limit(&self) -> usize
Return the maximum size of arrays treated as tuples.
Sourcepub fn with_file_extension(self, ext: impl Into<String>) -> Self
pub fn with_file_extension(self, ext: impl Into<String>) -> Self
Set the file extension for generated Flow files.
This is determined by your project’s JS module system:
"js.flow"— standard"cjs.flow"— CommonJS"mjs.flow"— ES modules
Sourcepub fn file_extension(&self) -> &str
pub fn file_extension(&self) -> &str
Return the file extension for generated files.
Sourcepub fn with_large_int(self, ty: impl Into<String>) -> Self
pub fn with_large_int(self, ty: impl Into<String>) -> Self
Set the Flow type used for large integers (i64, u64, i128, u128).
Default: "bigint" (matches ts-rs)
Sourcepub fn resolve_output_path(&self, base: &Path) -> PathBuf
pub fn resolve_output_path(&self, base: &Path) -> PathBuf
Resolve a type’s base output path (without extension) into a full path with extension.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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