[][src]Trait smart_path::PathRange

pub trait PathRange<T: ?Sized> {
    fn range(&self, range: T) -> Self;
}

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

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

Loading content...

Implementors

impl PathRange<Range<usize>> for SmartPathBuf[src]

fn range(&self, range: Range<usize>) -> Self[src]

Returns a new SmartPath from the range provided

impl PathRange<RangeFrom<usize>> for SmartPathBuf[src]

fn range(&self, range: RangeFrom<usize>) -> Self[src]

Returns a new SmartPath from the range provided

impl PathRange<RangeFull> for SmartPathBuf[src]

fn range(&self, range: RangeFull) -> Self[src]

Returns a new SmartPath from the range provided

impl PathRange<RangeTo<usize>> for SmartPathBuf[src]

fn range(&self, range: RangeTo<usize>) -> Self[src]

Returns a new SmartPath from the range provided

Loading content...