pub struct WorktreeBackend { /* private fields */ }Expand description
Worktree isolation backend (optionally layered on another backend).
Implementations§
Source§impl WorktreeBackend
impl WorktreeBackend
pub fn new() -> WorktreeBackend
pub fn with_options(opts: WorktreeOptions) -> WorktreeBackend
pub fn with_inner( inner: Arc<dyn EnforceBackend>, opts: WorktreeOptions, ) -> WorktreeBackend
pub fn worktree_path(&self) -> Option<PathBuf>
Trait Implementations§
Source§impl Default for WorktreeBackend
impl Default for WorktreeBackend
Source§fn default() -> WorktreeBackend
fn default() -> WorktreeBackend
Returns the “default value” for a type. Read more
Source§impl EnforceBackend for WorktreeBackend
impl EnforceBackend for WorktreeBackend
fn info(&self) -> BackendInfo
Source§fn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: &'life1 Policy,
sink: Arc<dyn RecordSink>,
) -> Pin<Box<dyn Future<Output = Result<(), EnforceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
WorktreeBackend: 'async_trait,
fn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: &'life1 Policy,
sink: Arc<dyn RecordSink>,
) -> Pin<Box<dyn Future<Output = Result<(), EnforceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
WorktreeBackend: 'async_trait,
Apply policy for this space. May be irreversible for kernel backends.
Source§fn check_fs<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
policy: &'life1 Policy,
path: &'life2 Path,
write: bool,
) -> Pin<Box<dyn Future<Output = Result<bool, EnforceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
WorktreeBackend: 'async_trait,
fn check_fs<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
policy: &'life1 Policy,
path: &'life2 Path,
write: bool,
) -> Pin<Box<dyn Future<Output = Result<bool, EnforceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
WorktreeBackend: 'async_trait,
Check whether a path operation would be allowed (best-effort soft check).
Source§fn spawn<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
space_id: &'life1 SpaceId,
policy: &'life2 Policy,
req: SpawnRequest,
sink: Arc<dyn RecordSink>,
) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess, EnforceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
WorktreeBackend: 'async_trait,
fn spawn<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
space_id: &'life1 SpaceId,
policy: &'life2 Policy,
req: SpawnRequest,
sink: Arc<dyn RecordSink>,
) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess, EnforceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
WorktreeBackend: 'async_trait,
Spawn a subprocess under the policy (soft or hard depending on backend).
Source§fn destroy<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: &'life1 Policy,
sink: Arc<dyn RecordSink>,
) -> Pin<Box<dyn Future<Output = Result<(), EnforceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
WorktreeBackend: 'async_trait,
fn destroy<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: &'life1 Policy,
sink: Arc<dyn RecordSink>,
) -> Pin<Box<dyn Future<Output = Result<(), EnforceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
WorktreeBackend: 'async_trait,
Tear down enforcement for this space (revoke, unmount, etc.).
Auto Trait Implementations§
impl !Freeze for WorktreeBackend
impl !RefUnwindSafe for WorktreeBackend
impl !UnwindSafe for WorktreeBackend
impl Send for WorktreeBackend
impl Sync for WorktreeBackend
impl Unpin for WorktreeBackend
impl UnsafeUnpin for WorktreeBackend
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