Struct knightrs::environment::Builder [−][src]
pub struct Builder<'i, 'o, 'c> { /* fields omitted */ }
A Builder for the Environment
struct.
Implementations
impl<'i, 'o, 'c> Builder<'i, 'o, 'c>
[src]
impl<'i, 'o, 'c> Builder<'i, 'o, 'c>
[src]#[must_use = "creating a builder does nothing by itself."]pub fn new() -> Self
[src]
#[must_use = "creating a builder does nothing by itself."]
pub fn new() -> SelfCreates a new, default Builder
.
#[must_use = "assigning a capacity does nothing without calling 'build'."]pub fn capacity(self, capacity: usize) -> Self
[src]
#[must_use = "assigning a capacity does nothing without calling 'build'."]
pub fn capacity(self, capacity: usize) -> SelfSets the initial starting capacity for the set of Variable
s.
If not set, an (unspecified) default capacity is used.
#[must_use = "assigning to stdin does nothing without calling 'build'."]pub fn stdin(self, stdin: &'i mut dyn Read) -> Self
[src]
#[must_use = "assigning to stdin does nothing without calling 'build'."]
pub fn stdin(self, stdin: &'i mut dyn Read) -> SelfSets the stdin for the Environment
.
This defaults to the stdin of the process.
#[must_use = "assigning to stdout does nothing without calling 'build'."]pub fn stdout(self, stdout: &'o mut dyn Write) -> Self
[src]
#[must_use = "assigning to stdout does nothing without calling 'build'."]
pub fn stdout(self, stdout: &'o mut dyn Write) -> SelfSets the stdout for the Environment
.
This defaults to the stdout of the process.
#[must_use = "assigning a 'system' does nothing without calling 'build'."]pub fn system(
self,
system: &'c mut dyn FnMut(&str) -> Result<Text, Error>
) -> Self
[src]
#[must_use = "assigning a 'system' does nothing without calling 'build'."]
pub fn system(self,
system: &'c mut dyn FnMut(&str) -> Result<Text, Error>
) -> Self
Explicitly sets what should happen when the “system” (`
) function is called.
The default value is to simply send the command to sh
(ie "sh", "-c", "command"
)
#[must_use = "disabling the system command to does nothing without calling 'build'."]pub fn disable_system(self) -> Self
[src]
#[must_use = "disabling the system command to does nothing without calling 'build'."]
pub fn disable_system(self) -> SelfDisables the “system” (`
) command entirely.
When this is enabled, all calls to `
will return errors.
#[must_use = "Simply calling `build` does nothing on its own."]pub fn build(self) -> Environment<'i, 'o, 'c>ⓘNotable traits for Environment<'_, '_, '_>
impl Read for Environment<'_, '_, '_>impl Write for Environment<'_, '_, '_>
[src]
#[must_use = "Simply calling `build` does nothing on its own."]
pub fn build(self) -> Environment<'i, 'o, 'c>ⓘNotable traits for Environment<'_, '_, '_>
impl Read for Environment<'_, '_, '_>impl Write for Environment<'_, '_, '_>
Creates a new Environment
with all the supplied options.
Any options that have not been explicitly set will have their default values used.
Trait Implementations
Auto Trait Implementations
impl<'i, 'o, 'c> !RefUnwindSafe for Builder<'i, 'o, 'c>
impl<'i, 'o, 'c> !RefUnwindSafe for Builder<'i, 'o, 'c>
impl<'i, 'o, 'c> !UnwindSafe for Builder<'i, 'o, 'c>
impl<'i, 'o, 'c> !UnwindSafe for Builder<'i, 'o, 'c>