Skip to main content

PathResolver

Trait PathResolver 

Source
pub trait PathResolver: Send + Sync {
    // Required method
    fn resolve_path(&self, path: KnownPath) -> Result<String, HostApiError>;
}
Expand description

路径解析器 trait,定义平台原语。 各平台实现通过系统 API 将 KnownPath 枚举映射为实际文件系统路径。

Required Methods§

Source

fn resolve_path(&self, path: KnownPath) -> Result<String, HostApiError>

根据 KnownPath 类型解析实际文件系统路径。 参数:path - 已知路径类型枚举。 返回:解析后的路径字符串,失败返回 HostApiError。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§