pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for Config.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn before(self, value: Vec<String>) -> Self
pub fn before(self, value: Vec<String>) -> Self
Code that runs before the REPL in an async context. setup, etc.
Sourcepub fn after(self, value: Vec<String>) -> Self
pub fn after(self, value: Vec<String>) -> Self
Code that runs after the REPL. teardown, etc. Run in reverse order.
Sourcepub fn script_file_name(self, value: String) -> Self
pub fn script_file_name(self, value: String) -> Self
Name of the file within which the REPL is run.
Sourcepub fn build_command(
self,
value: Option<Box<dyn Fn(&Config, &str, &str) -> String>>,
) -> Self
pub fn build_command( self, value: Option<Box<dyn Fn(&Config, &str, &str) -> String>>, ) -> Self
A function that constructs the shell script which runs the REPL.
It is passed the config, the directory the REPL is run from, and the full path to the script_file_name file.
Result looks like: NODE_PATH=../node_modules /path/to/nodejs_binary /path/to/tmp/repl_script.js.
Sourcepub fn copy_dirs(self, value: Vec<String>) -> Self
pub fn copy_dirs(self, value: Vec<String>) -> Self
A list paths that will be copied into the tempfile::TempDir alongside the REPL script.
Useful for importing custom code.
Sourcepub fn path_to_node_modules(self, value: Option<String>) -> Self
pub fn path_to_node_modules(self, value: Option<String>) -> Self
Path to a node_modules directory which node will use.
Sourcepub fn node_binary(self, value: String) -> Self
pub fn node_binary(self, value: String) -> Self
Path to node binary.
Sourcepub fn eof(self, value: Vec<u8>) -> Self
pub fn eof(self, value: Vec<u8>) -> Self
Delimiter used to signal end of a single loop in the REPL.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl !RefUnwindSafe for ConfigBuilder
impl !Send for ConfigBuilder
impl !Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl !UnwindSafe for ConfigBuilder
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