pub struct WorkspaceResolver { /* private fields */ }Expand description
One coherent default/root provider pair.
The process-wide registration APIs remain first-wins for production and
embedding compatibility. A server AppState also retains an instance of
this resolver so multiple states in one test process cannot mix the first
state’s live config with another state’s session persistence.
Implementations§
Source§impl WorkspaceResolver
impl WorkspaceResolver
Sourcepub fn new<D, R>(default_provider: D, root_provider: R) -> WorkspaceResolver
pub fn new<D, R>(default_provider: D, root_provider: R) -> WorkspaceResolver
Build an instance-scoped resolver from live providers.
Sourcepub fn from_process_globals() -> WorkspaceResolver
pub fn from_process_globals() -> WorkspaceResolver
Dynamically delegate to the process-global first-wins providers.
Registration state is intentionally read on every call, not captured here, so a resolver constructed before server bootstrap retains the historical no-provider/provider transition semantics.
Sourcepub fn workspace_root_config(&self) -> Option<WorkspaceRootConfig>
pub fn workspace_root_config(&self) -> Option<WorkspaceRootConfig>
Return the current instance root and confinement policy.
Sourcepub fn resolve_session_workspace_candidate(
&self,
session_id: &str,
preferred: Option<PathBuf>,
) -> Option<PathBuf>
pub fn resolve_session_workspace_candidate( &self, session_id: &str, preferred: Option<PathBuf>, ) -> Option<PathBuf>
Resolve a session workspace through this provider pair without publishing state or creating directories.
Sourcepub fn preview_workspace_path(&self, workspace: PathBuf) -> PathBuf
pub fn preview_workspace_path(&self, workspace: PathBuf) -> PathBuf
Apply this instance’s confinement policy without filesystem mutation.
Sourcepub fn preview_session_fallback(&self, session_id: &str) -> Option<PathBuf>
pub fn preview_session_fallback(&self, session_id: &str) -> Option<PathBuf>
Preview this resolver’s session-scoped root fallback only.
Unlike Self::resolve_session_workspace_candidate, this deliberately
does not consult the process-global runtime registry or a configured
default. Server transaction paths use it when their own live config
snapshot has authoritatively resolved no default workspace.
Sourcepub fn publish_resolved_workspace(
&self,
session_id: &str,
workspace: PathBuf,
source: &str,
) -> PathBuf
pub fn publish_resolved_workspace( &self, session_id: &str, workspace: PathBuf, source: &str, ) -> PathBuf
Publish a previously validated candidate through this instance’s root.
Missing paths are materialized only when they are contained by this
resolver’s root. source is a non-secret diagnostic label supplied by
the caller (for example session_fallback).
Trait Implementations§
Source§impl Clone for WorkspaceResolver
impl Clone for WorkspaceResolver
Source§fn clone(&self) -> WorkspaceResolver
fn clone(&self) -> WorkspaceResolver
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more