pub struct LocalProvider { /* private fields */ }Expand description
Provider that runs tests as local child processes.
This is the simplest provider implementation. Each sandbox is just a logical grouping with a shared configuration - commands are run as child processes of the offload process itself.
§Thread Safety
The provider is thread-safe and can be shared across async tasks.
Implementations§
Source§impl LocalProvider
impl LocalProvider
Sourcepub fn new(config: LocalProviderConfig) -> Self
pub fn new(config: LocalProviderConfig) -> Self
Creates a new process provider with the given configuration.
§Arguments
config- Configuration specifying working directory, environment variables, and shell to use
§Example
use offload::provider::local::LocalProvider;
use offload::config::LocalProviderConfig;
// With defaults
let provider = LocalProvider::new(LocalProviderConfig::default());
// With custom config
let config = LocalProviderConfig {
working_dir: Some("/app".into()),
shell: "/bin/bash".to_string(),
..Default::default()
};
let provider = LocalProvider::new(config);Trait Implementations§
Source§impl SandboxProvider for LocalProvider
impl SandboxProvider for LocalProvider
Source§fn create_sandbox<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 SandboxConfig,
) -> Pin<Box<dyn Future<Output = ProviderResult<LocalSandbox>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_sandbox<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 SandboxConfig,
) -> Pin<Box<dyn Future<Output = ProviderResult<LocalSandbox>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new sandbox with the given configuration. Read more
Auto Trait Implementations§
impl Freeze for LocalProvider
impl RefUnwindSafe for LocalProvider
impl Send for LocalProvider
impl Sync for LocalProvider
impl Unpin for LocalProvider
impl UnsafeUnpin for LocalProvider
impl UnwindSafe for LocalProvider
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