[][src]Struct devbox_build::Dir

pub struct Dir { /* fields omitted */ }

Resource representing file system directory

Implementations

impl Dir[src]

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

Create new Dir pointing to absolute file system path panicking if failed

pub fn new_safe<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>[src]

Create new Dir pointing to absolute file system path

pub fn path(&self) -> &Path[src]

Path reference to file system directory

pub fn created(self) -> Self[src]

Creates the directory using create and returns itself or stops the build with informative error message.

pub fn create(&self)[src]

Creates the directory using create_result or stops the build with informative error message.

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

Creates the directory and any missing parent directories on it's path.

pub fn content<G: AsRef<str>>(&self, glob: G) -> DirContent<Unit>[src]

All directory content (files, directories and links) matching given glob file name pattern

pub fn dirs<G: AsRef<str>>(&self, glob: G) -> DirContent<Dir>[src]

All subdirectories and directory links matching given glob file name pattern

pub fn files<G: AsRef<str>>(&self, glob: G) -> DirContent<File>[src]

All files and file links matching given glob file name pattern

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

Subdirectory at given relative path

Will stop the build with informative error message if path is not relative.

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

Subdirectory at given relative path

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

A file at given relative path

Will stop the build with informative error message if path is not relative.

pub fn file_result<P: AsRef<Path>>(
    &self,
    path: P
) -> Result<File, Box<dyn Error>>
[src]

A file at given relative path

pub fn linked_from_inside(self, dir: &Dir) -> Self[src]

Creating a link to this directory from another directory with this directory's name returning self or stopping the build with informative error message.

If the directory already contains an entry with this name, linking fails.

Creating a link to this directory from another directory with this directory's name or stopping the build with informative error message.

If the directory already contains an entry with this name, linking fails.

Creating a link to this directory from another directory with this directory's name.

If the directory already contains a file or directory by this name, linking fails. To allow overwriting existing link with different target set force to true or linking to this directory will also fail.

pub fn linked_to(self, to: &Dir) -> Self[src]

Create a symbolic link at this directory path to given target directory to creating any needed directories in the process returning self or stopping the build with informative error message.

If a file or directory by that name already exists, linking will fail.

Create a symbolic link at this directory path to given target directory to creating any needed directories in the process or stopping the build with informative error message.

If a file or directory by that name already exists, linking will fail.

Create a symbolic link at this directory path to given target directory to creating any needed directories in the process.

If a file or directory by that name already exists, linking will fail. To allow overwriting existing link to a different directory set force to true or linking to a different directory will also fail.

pub fn touched(self) -> Self[src]

Touches the directory using touch and returns itself or stops the build with informative error message

pub fn touch(&self)[src]

Touches the directory using touch and returns itself or stops the build with informative error message.

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

Touches the directory by updating it's modification time or creating a new one if it does not exists yet including any needed directories.

Trait Implementations

impl<'_, '_> Add<&'_ Dir> for &'_ File[src]

type Output = Set<Unit>

The resulting type after applying the + operator.

impl<'_, '_> Add<&'_ Dir> for &'_ Dir[src]

type Output = Set<Dir>

The resulting type after applying the + operator.

impl<'_, '_> Add<&'_ File> for &'_ Dir[src]

type Output = Set<Unit>

The resulting type after applying the + operator.

impl AsRef<Dir> for Dir[src]

impl AsRef<OsStr> for Dir[src]

impl AsRef<Path> for Dir[src]

impl Clone for Dir[src]

impl Debug for Dir[src]

impl Display for Dir[src]

impl Eq for Dir[src]

impl Hash for Dir[src]

impl Ord for Dir[src]

impl PartialEq<Dir> for Dir[src]

impl PartialOrd<Dir> for Dir[src]

impl Resource for Dir[src]

impl StructuralEq for Dir[src]

impl StructuralPartialEq for Dir[src]

Auto Trait Implementations

impl RefUnwindSafe for Dir

impl Send for Dir

impl Sync for Dir

impl Unpin for Dir

impl UnwindSafe for Dir

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> From<T> 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.