use crate::prelude::*;
impl SegmentedPath<'_> {
pub fn iter_strs(&self) -> SplitSlashes<'_> {
match self {
Self::File (x) => x.iter_strs(),
Self::SpecialNotFile(x) => x.iter_strs(),
Self::NonSpecial (x) => x.iter_strs(),
}
}
pub fn get_str(&self, index: isize) -> Option<&str> {
match self {
Self::File (x) => x.get_str(index),
Self::SpecialNotFile(x) => x.get_str(index),
Self::NonSpecial (x) => x.get_str(index),
}
}
pub fn range_str<B: RangeBounds<isize>>(&self, range: B) -> Option<&str> {
match self {
Self::File (x) => x.range_str(range),
Self::SpecialNotFile(x) => x.range_str(range),
Self::NonSpecial (x) => x.range_str(range),
}
}
pub fn iter(&self) -> PathSegmentsIter<'_> {
match self {
Self::File (x) => x.iter().into(),
Self::SpecialNotFile(x) => x.iter().into(),
Self::NonSpecial (x) => x.iter().into(),
}
}
pub fn get(&self, index: isize) -> Option<PathSegment<'_>> {
match self {
Self::File (x) => x.get(index).map(Into::into),
Self::SpecialNotFile(x) => x.get(index).map(Into::into),
Self::NonSpecial (x) => x.get(index).map(Into::into),
}
}
pub fn range<B: RangeBounds<isize>>(&self, range: B) -> Option<PathSegments<'_>> {
match self {
Self::File (x) => x.range(range).map(Into::into),
Self::SpecialNotFile(x) => x.range(range).map(Into::into),
Self::NonSpecial (x) => x.range(range).map(Into::into),
}
}
}