pub struct RustBashBuilder { /* private fields */ }Expand description
Builder for configuring a RustBash instance.
Implementations§
Source§impl RustBashBuilder
impl RustBashBuilder
Sourcepub fn files(self, files: HashMap<String, Vec<u8>>) -> Self
pub fn files(self, files: HashMap<String, Vec<u8>>) -> Self
Pre-populate the virtual filesystem with files.
Sourcepub fn cwd(self, cwd: impl Into<String>) -> Self
pub fn cwd(self, cwd: impl Into<String>) -> Self
Set the initial working directory (created automatically).
Sourcepub fn command(self, cmd: Arc<dyn VirtualCommand>) -> Self
pub fn command(self, cmd: Arc<dyn VirtualCommand>) -> Self
Register a custom command.
Sourcepub fn execution_limits(self, limits: ExecutionLimits) -> Self
pub fn execution_limits(self, limits: ExecutionLimits) -> Self
Override the default execution limits.
Sourcepub fn max_array_elements(self, max: usize) -> Self
pub fn max_array_elements(self, max: usize) -> Self
Set the maximum number of elements allowed in a single array.
Sourcepub fn network_policy(self, policy: NetworkPolicy) -> Self
pub fn network_policy(self, policy: NetworkPolicy) -> Self
Override the default network policy.
Sourcepub fn fs(self, fs: Arc<dyn VirtualFs>) -> Self
pub fn fs(self, fs: Arc<dyn VirtualFs>) -> Self
Use a custom filesystem backend instead of the default InMemoryFs.
When set, the builder uses this filesystem directly. The .files() method
still works — it writes seed files into the provided backend via VirtualFs
methods.
Sourcepub fn build(self) -> Result<RustBash, RustBashError>
pub fn build(self) -> Result<RustBash, RustBashError>
Build the shell instance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RustBashBuilder
impl !RefUnwindSafe for RustBashBuilder
impl Send for RustBashBuilder
impl Sync for RustBashBuilder
impl Unpin for RustBashBuilder
impl UnsafeUnpin for RustBashBuilder
impl !UnwindSafe for RustBashBuilder
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