pub struct PathUtils;Expand description
Path utilities for proxy workflows.
Implementations§
Source§impl PathUtils
impl PathUtils
Sourcepub fn normalize_path(path: &Path) -> PathBuf
pub fn normalize_path(path: &Path) -> PathBuf
Normalize path separators for cross-platform compatibility.
Sourcepub fn get_relative_path(base: &Path, target: &Path) -> Result<PathBuf>
pub fn get_relative_path(base: &Path, target: &Path) -> Result<PathBuf>
Get relative path from base to target.
§Errors
Returns an error if the paths don’t share a common base.
Sourcepub fn make_absolute(path: &Path) -> PathBuf
pub fn make_absolute(path: &Path) -> PathBuf
Make path absolute.
Sourcepub fn change_extension(path: &Path, new_ext: &str) -> PathBuf
pub fn change_extension(path: &Path, new_ext: &str) -> PathBuf
Change file extension.
Sourcepub fn make_unique_filename(path: &Path) -> PathBuf
pub fn make_unique_filename(path: &Path) -> PathBuf
Generate unique filename by appending number.
Sourcepub fn are_same_file(path1: &Path, path2: &Path) -> bool
pub fn are_same_file(path1: &Path, path2: &Path) -> bool
Check if two paths point to the same file.
Auto Trait Implementations§
impl Freeze for PathUtils
impl RefUnwindSafe for PathUtils
impl Send for PathUtils
impl Sync for PathUtils
impl Unpin for PathUtils
impl UnsafeUnpin for PathUtils
impl UnwindSafe for PathUtils
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more