Skip to main content

PathOperations

Trait PathOperations 

Source
pub trait PathOperations {
    // Required methods
    fn split_path(&self, path: &str) -> Vec<String>;
    fn join_path(&self, components: &[String]) -> String;
    fn parent_path(&self, path: &str) -> Option<String>;
    fn last_component(&self, path: &str) -> Option<String>;
}
Expand description

Path operations for hierarchical data.

Required Methods§

Source

fn split_path(&self, path: &str) -> Vec<String>

Split a path into components.

Source

fn join_path(&self, components: &[String]) -> String

Join path components into a full path.

Source

fn parent_path(&self, path: &str) -> Option<String>

Get parent path from a path.

Source

fn last_component(&self, path: &str) -> Option<String>

Get the last component of a path.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§