pub struct DefaultPathResolver {
pub file_separator: char,
}Expand description
The default PathResolver implementation, mirroring the Ruby Asciidoctor
PathResolver class.
The main emphasis of the struct is on creating clean and secure paths. Clean paths are void of duplicate parent and current directory references in the path name. Secure paths are paths which are restricted from accessing directories outside of a jail path, if specified.
Since joining two paths can result in an insecure path, this struct also handles the task of joining a parent (start) and child (target) path.
Like its counterpart in the Ruby Asciidoctor implementation, this struct makes no use of path utilities from the underlying Rust libraries. Instead, it handles all aspects of path manipulation. The main benefit of internalizing these operations is that the struct is able to handle both Posix and Windows paths independent of the operating system on which it runs. This makes the class both deterministic and easier to test.
Fields§
§file_separator: charFile separator to use for path operations. (Defaults to platform-appropriate separator.)
Implementations§
Trait Implementations§
Source§impl Clone for DefaultPathResolver
impl Clone for DefaultPathResolver
Source§fn clone(&self) -> DefaultPathResolver
fn clone(&self) -> DefaultPathResolver
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more