pub struct Config {
pub base_dir: PathBuf,
pub shell_cmd: String,
pub inputs: Vec<String>,
pub recursive: bool,
pub num_threads: usize,
pub mode: Mode,
pub verbosity: Verbosity,
pub trailing_newline: bool,
}Expand description
Config for running txtpp
Use this to configure txtpp when calling it from the library
Example
use txtpp::{Txtpp, Config, Verbosity};
// Use the default config
let mut cfg = Config::default();
// Change verbosity to verbose
cfg.verbosity = Verbosity::Verbose;
Txtpp::run(cfg).unwrap();Fields§
§base_dir: PathBufBase directory for resolving paths in input. This is usually the current directory.
shell_cmd: StringThe shell command to use. (e.g. bash -c). Empty string for platform-specific default shell
inputs: Vec<String>The input file/directories
recursive: boolWhether to recursively process directories
num_threads: usizeThe number of threads to use
mode: ModeThe mode. See `Mode
verbosity: VerbosityThe verbosity. See Verbosity
trailing_newline: boolIf the output files should have trailing newline
Trait Implementations§
source§impl Default for Config
impl Default for Config
source§fn default() -> Self
fn default() -> Self
Get the default config.
This means:
- Running from the current directory
- Using the platform-specific default shell
- Processing the current directory
- Not recursively processing directories
- Using 4 threads
- Building output files
- Regular verbosity
- Output files have trailing newline
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin 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