[−][src]Struct devbox_build::Dir
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]
&self,
path: P
) -> Result<Self, Box<dyn Error>>
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]
&self,
path: P
) -> Result<File, Box<dyn Error>>
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.
pub fn link_from_inside(&self, dir: &Dir)
[src]
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.
pub fn link_from_inside_result(&self, dir: &Dir, force: bool) -> Result<()>
[src]
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.
pub fn link_to(&self, to: &Dir)
[src]
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.
pub fn link_to_result(&self, to: &Dir, force: bool) -> Result<()>
[src]
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.
fn add(self, rhs: &Dir) -> Self::Output
[src]
impl<'_, '_> Add<&'_ Dir> for &'_ Dir
[src]
type Output = Set<Dir>
The resulting type after applying the +
operator.
fn add(self, rhs: &Dir) -> Self::Output
[src]
impl<'_, '_> Add<&'_ File> for &'_ Dir
[src]
type Output = Set<Unit>
The resulting type after applying the +
operator.
fn add(self, rhs: &File) -> Self::Output
[src]
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Dir
[src]
fn cmp(&self, other: &Dir) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Dir> for Dir
[src]
impl PartialOrd<Dir> for Dir
[src]
fn partial_cmp(&self, other: &Dir) -> Option<Ordering>
[src]
fn lt(&self, other: &Dir) -> bool
[src]
fn le(&self, other: &Dir) -> bool
[src]
fn gt(&self, other: &Dir) -> bool
[src]
fn ge(&self, other: &Dir) -> bool
[src]
impl Resource for Dir
[src]
fn timestamp(&self) -> Option<SystemTime>
[src]
fn mk_from<F, R, S>(&self, description: &str, src: S, by: F) where
R: Resource,
S: AsResource<R>,
F: FnOnce(),
[src]
R: Resource,
S: AsResource<R>,
F: FnOnce(),
fn mk_from_result<E, F, R, S>(
&self,
description: &str,
src: S,
by: F
) -> Result<(), E> where
R: Resource,
S: AsRef<R>,
F: FnOnce() -> Result<(), E>,
[src]
&self,
description: &str,
src: S,
by: F
) -> Result<(), E> where
R: Resource,
S: AsRef<R>,
F: FnOnce() -> Result<(), E>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,