pub struct ProcessSessionRequest { /* private fields */ }Expand description
Request options for deriving a scoped ProcessSession from a ProcessBackend.
Implementations§
Source§impl ProcessSessionRequest
impl ProcessSessionRequest
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a default session request inheriting the backend’s workspace root and writability.
Sourcepub fn with_workspace_root(self, workspace_root: impl Into<PathBuf>) -> Self
pub fn with_workspace_root(self, workspace_root: impl Into<PathBuf>) -> Self
Overrides the workspace root directory for the new session (for example, an isolated git worktree).
Sourcepub fn read_only_workspace(self) -> Self
pub fn read_only_workspace(self) -> Self
Keeps the workspace readable and not writable for isolated actions in this session.
Sourcepub fn with_workspace_writable(self, writable: bool) -> Self
pub fn with_workspace_writable(self, writable: bool) -> Self
Sets whether isolated actions in this session may write inside the workspace root.
A request cannot widen a backend that was already configured read-only.
Sourcepub fn with_inherited_permissions(
self,
view: ProcessSessionPermissionView,
) -> Self
pub fn with_inherited_permissions( self, view: ProcessSessionPermissionView, ) -> Self
Seeds the new session with a read-only snapshot of an existing session’s approved ordinary capabilities.
Sourcepub fn with_extra_path_rules(
self,
rules: impl IntoIterator<Item = PathAccessRule>,
) -> Self
pub fn with_extra_path_rules( self, rules: impl IntoIterator<Item = PathAccessRule>, ) -> Self
Appends additional filesystem rules for the new session.
Sourcepub fn workspace_root(&self) -> Option<&Path>
pub fn workspace_root(&self) -> Option<&Path>
Returns the optional workspace root override.
Sourcepub const fn workspace_writable(&self) -> bool
pub const fn workspace_writable(&self) -> bool
Returns whether the caller requested workspace writability.
Sourcepub fn inherited_permissions(&self) -> Option<&ProcessSessionPermissionView>
pub fn inherited_permissions(&self) -> Option<&ProcessSessionPermissionView>
Returns the optional inherited permission view.
Sourcepub fn extra_path_rules(&self) -> &[PathAccessRule]
pub fn extra_path_rules(&self) -> &[PathAccessRule]
Returns any extra filesystem access rules attached to this request.