pub struct PathLike<D, R> { /* private fields */ }Available on crate feature
path only.Expand description
Special type which helps to output different path-like types.
Everything that produces fmt::Display items while being iterated can be outputted this way.
Implements crate::Params and intended to be used as argument of crate::WithParams::with_params.
use cubob::{PathLike, WithParams};
let path_like_1 = vec!["A", "a", "1"];
let path_like_2 = [1, 2, 3, 4];
assert_eq!(path_like_1.with_params(PathLike::STRUCT).to_string(), "A.a.1");
assert_eq!(path_like_1.with_params(PathLike::LIST).to_string(), "A, a, 1");
assert_eq!(path_like_2.with_params(PathLike::FS_RELATIVE).to_string(), "1/2/3/4");
assert_eq!(path_like_2.with_params(PathLike::ROUTE).to_string(), "1->2->3->4");
Implementations§
Source§impl PathLike<char, char>
impl PathLike<char, char>
pub const FS_RELATIVE: &'static Self
pub const FS_ABSOLUTE: &'static Self
Source§impl<D1, R> PathLike<D1, R>
impl<D1, R> PathLike<D1, R>
pub fn with_delimiter<D2>(self, delimiter: D2) -> PathLike<D2, R>
Trait Implementations§
Auto Trait Implementations§
impl<D, R> Freeze for PathLike<D, R>
impl<D, R> RefUnwindSafe for PathLike<D, R>where
D: RefUnwindSafe,
R: RefUnwindSafe,
impl<D, R> Send for PathLike<D, R>
impl<D, R> Sync for PathLike<D, R>
impl<D, R> Unpin for PathLike<D, R>
impl<D, R> UnwindSafe for PathLike<D, R>where
D: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, P> WithParams<P> for Twhere
P: Params<T>,
impl<T, P> WithParams<P> for Twhere
P: Params<T>,
Source§fn with_params<'a>(&'a self, params: &'a P) -> Parameterized<'a, T, P>
fn with_params<'a>(&'a self, params: &'a P) -> Parameterized<'a, T, P>
Available on crate feature
params only.