pub struct Path<'a, 'b> { /* private fields */ }Expand description
A Path can be used to represent a path.
A path is a sequence of parts that are joined together by a joiner. The joiner is a string that is used to split the path into parts and into a PathBuf.
§Example
use postcard_bindgen_core::path::Path;
let path = Path::new("foo/bar/baz", "/");
assert_eq!(path.parts().collect::<Vec<&str>>(), vec!["foo", "bar", "baz"]);Implementations§
Source§impl<'a, 'b> Path<'a, 'b>
impl<'a, 'b> Path<'a, 'b>
Sourcepub fn parts(&self) -> impl Iterator<Item = &str>
pub fn parts(&self) -> impl Iterator<Item = &str>
Gives an iterator over the parts of the path.
Sourcepub fn into_buf(self) -> PathBuf<'a>
pub fn into_buf(self) -> PathBuf<'a>
Convert the path into a PathBuf by consuming the path and splitting it into parts.
Sourcepub fn into_owned(self) -> Path<'static, 'static>
pub fn into_owned(self) -> Path<'static, 'static>
Convert the path into an owned path by consuming the path.
Trait Implementations§
Source§impl<L: Lang> FormatInto<L> for Path<'_, '_>
impl<L: Lang> FormatInto<L> for Path<'_, '_>
Source§fn format_into(self, t: &mut Tokens<L>)
fn format_into(self, t: &mut Tokens<L>)
Convert the type into tokens in-place. Read more
impl<'a, 'b> Eq for Path<'a, 'b>
impl<'a, 'b> StructuralPartialEq for Path<'a, 'b>
Auto Trait Implementations§
impl<'a, 'b> Freeze for Path<'a, 'b>
impl<'a, 'b> RefUnwindSafe for Path<'a, 'b>
impl<'a, 'b> Send for Path<'a, 'b>
impl<'a, 'b> Sync for Path<'a, 'b>
impl<'a, 'b> Unpin for Path<'a, 'b>
impl<'a, 'b> UnwindSafe for Path<'a, 'b>
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