pub struct AbsPathBuf(/* private fields */);Expand description
An absolute (not necessarily canonicalized) path that may or may not exist.
Implementations§
Source§impl AbsPathBuf
impl AbsPathBuf
Sourcepub fn try_new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn try_new<P: AsRef<Path>>(path: P) -> Result<Self>
Construct an absolute path.
Returns error if path is not absolute.
If path need to be shell-expanded, use AbsPathBuf::from_shell_path instead.
Sourcepub fn from_shell_path<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_shell_path<P: AsRef<Path>>(path: P) -> Result<Self>
Constructs an absolute path whilte expanding leading tilde and environment variables.
Returns error if expanded path is not absolute.
Sourcepub fn join_expand<P: AsRef<Path>>(&self, path: P) -> Result<Self>
pub fn join_expand<P: AsRef<Path>>(&self, path: P) -> Result<Self>
Joins path while expanding leading tilde and environment variables.
pub fn search_dir_contains(&self, file_name: &str) -> Option<Self>
pub fn save_pretty( &self, save: impl FnOnce(File) -> Result<()>, overwrite: bool, base_dir: Option<&AbsPathBuf>, cnsl: &mut dyn Write, ) -> Result<Option<bool>>
pub fn save( &self, save: impl FnOnce(File) -> Result<()>, overwrite: bool, ) -> Result<Option<bool>>
pub fn load_pretty<T>( &self, load: impl FnOnce(File) -> Result<T>, base_dir: Option<&AbsPathBuf>, cnsl: &mut dyn Write, ) -> Result<T>
pub fn load<T>(&self, load: impl FnOnce(File) -> Result<T>) -> Result<T>
pub fn remove_dir_all_pretty( &self, base_dir: Option<&AbsPathBuf>, cnsl: &mut dyn Write, ) -> Result<bool>
pub fn remove_file_pretty( &self, base_dir: Option<&AbsPathBuf>, cnsl: &mut dyn Write, ) -> Result<bool>
pub fn move_from_pretty( &self, from: &AbsPathBuf, base_dir: Option<&AbsPathBuf>, cnsl: &mut dyn Write, ) -> Result<()>
pub fn create_dir_all_and_open( &self, is_read: bool, is_write: bool, ) -> Result<File>
pub fn create_dir_all(&self) -> Result<()>
pub fn strip_prefix(&self, base: &AbsPathBuf) -> &Path
Trait Implementations§
Source§impl AsRef<PathBuf> for AbsPathBuf
impl AsRef<PathBuf> for AbsPathBuf
Source§impl Clone for AbsPathBuf
impl Clone for AbsPathBuf
Source§fn clone(&self) -> AbsPathBuf
fn clone(&self) -> AbsPathBuf
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AbsPathBuf
impl Debug for AbsPathBuf
Source§impl<'de> Deserialize<'de> for AbsPathBuf
impl<'de> Deserialize<'de> for AbsPathBuf
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AbsPathBuf
impl Display for AbsPathBuf
Source§impl FromStr for AbsPathBuf
impl FromStr for AbsPathBuf
Source§impl Hash for AbsPathBuf
impl Hash for AbsPathBuf
Source§impl PartialEq for AbsPathBuf
impl PartialEq for AbsPathBuf
Source§impl Serialize for AbsPathBuf
impl Serialize for AbsPathBuf
impl Eq for AbsPathBuf
impl StructuralPartialEq for AbsPathBuf
Auto Trait Implementations§
impl Freeze for AbsPathBuf
impl RefUnwindSafe for AbsPathBuf
impl Send for AbsPathBuf
impl Sync for AbsPathBuf
impl Unpin for AbsPathBuf
impl UnwindSafe for AbsPathBuf
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.