Trait PathRange

Source
pub trait PathRange<T: ?Sized> {
    // Required method
    fn range(&self, range: T) -> Self;
}
Expand description

Allows SmartPathBufs to be sliced using Range syntax.

§Example

use std::path::PathBuf;
use smart_path::{SmartPathBuf, PathRange};

let mut path = SmartPathBuf::from("hello/world/bye");
let p = path.range(..path.len() - 1);
assert_eq!(p.as_path(), PathBuf::from("hello/world").as_path());

Required Methods§

Source

fn range(&self, range: T) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§