pub struct HostSandbox;Expand description
直接在宿主机上执行命令、读写真实文件系统的 sandbox。
这是默认实现,行为等价于“不沙箱“,不提供任何隔离。
Implementations§
Source§impl HostSandbox
impl HostSandbox
Trait Implementations§
Source§impl Default for HostSandbox
impl Default for HostSandbox
Source§fn default() -> HostSandbox
fn default() -> HostSandbox
Returns the “default value” for a type. Read more
Source§impl Sandbox for HostSandbox
impl Sandbox for HostSandbox
Source§fn open<'life0, 'async_trait>(
self: Arc<Self>,
_session_id: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Sandbox>, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open<'life0, 'async_trait>(
self: Arc<Self>,
_session_id: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Sandbox>, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
打开或恢复某个 session 对应的 sandbox。实现应保持幂等:同一 session 多次 open
应恢复到同一份状态,并且 bootstrap 逻辑不应重复破坏环境。
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 str,
on_output: Option<OutputCallback>,
) -> Pin<Box<dyn Future<Output = Result<ExecOutput, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 str,
on_output: Option<OutputCallback>,
) -> Pin<Box<dyn Future<Output = Result<ExecOutput, SandboxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行一条命令并返回结果。 Read more
Auto Trait Implementations§
impl Freeze for HostSandbox
impl RefUnwindSafe for HostSandbox
impl Send for HostSandbox
impl Sync for HostSandbox
impl Unpin for HostSandbox
impl UnsafeUnpin for HostSandbox
impl UnwindSafe for HostSandbox
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