[][src]Struct acick_util::abs_path::AbsPathBuf

pub struct AbsPathBuf(_);

An absolute (not necessarily canonicalized) path that may or may not exist.

Implementations

impl AbsPathBuf[src]

pub fn try_new<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Construct an absolute path.

Returns error if path is not absolute.

If path need to be shell-expanded, use AbsPathBuf::from_shell_path instead.

pub fn from_shell_path<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Constructs an absolute path whilte expanding leading tilde and environment variables.

Returns error if expanded path is not absolute.

pub fn cwd() -> Result<Self>[src]

Returns current directory as an absolute path.

pub fn join<P: AsRef<Path>>(&self, path: P) -> Self[src]

Joins path.

pub fn join_expand<P: AsRef<Path>>(&self, path: P) -> Result<Self>[src]

Joins path while expanding leading tilde and environment variables.

pub fn parent(&self) -> Option<Self>[src]

Returns parent path.

pub fn search_dir_contains(&self, file_name: &str) -> Option<Self>[src]

pub fn save_pretty(
    &self,
    save: impl FnOnce(File) -> Result<()>,
    overwrite: bool,
    base_dir: Option<&AbsPathBuf>,
    cnsl: &mut dyn Write
) -> Result<Option<bool>>
[src]

pub fn save(
    &self,
    save: impl FnOnce(File) -> Result<()>,
    overwrite: bool
) -> Result<Option<bool>>
[src]

pub fn load_pretty<T>(
    &self,
    load: impl FnOnce(File) -> Result<T>,
    base_dir: Option<&AbsPathBuf>,
    cnsl: &mut dyn Write
) -> Result<T>
[src]

pub fn load<T>(&self, load: impl FnOnce(File) -> Result<T>) -> Result<T>[src]

pub fn remove_dir_all_pretty(
    &self,
    base_dir: Option<&AbsPathBuf>,
    cnsl: &mut dyn Write
) -> Result<bool>
[src]

pub fn remove_file_pretty(
    &self,
    base_dir: Option<&AbsPathBuf>,
    cnsl: &mut dyn Write
) -> Result<bool>
[src]

pub fn move_from_pretty(
    &self,
    from: &AbsPathBuf,
    base_dir: Option<&AbsPathBuf>,
    cnsl: &mut dyn Write
) -> Result<()>
[src]

pub fn create_dir_all_and_open(
    &self,
    is_read: bool,
    is_write: bool
) -> Result<File>
[src]

pub fn create_dir_all(&self) -> Result<()>[src]

pub fn strip_prefix(&self, base: &AbsPathBuf) -> &Path[src]

Trait Implementations

impl AsRef<PathBuf> for AbsPathBuf[src]

impl Clone for AbsPathBuf[src]

impl Debug for AbsPathBuf[src]

impl<'de> Deserialize<'de> for AbsPathBuf[src]

impl Display for AbsPathBuf[src]

impl Eq for AbsPathBuf[src]

impl FromStr for AbsPathBuf[src]

type Err = Error

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

Converts str to AbsPathBuf.

Note that this method expands leading tilde and environment variables.

impl Hash for AbsPathBuf[src]

impl PartialEq<AbsPathBuf> for AbsPathBuf[src]

impl Serialize for AbsPathBuf[src]

impl StructuralEq for AbsPathBuf[src]

impl StructuralPartialEq for AbsPathBuf[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,