Struct dagger_sdk::Directory

source ·
pub struct Directory {
    pub proc: Arc<Child>,
    pub selection: Selection,
    pub conn: ConnectParams,
}

Fields§

§proc: Arc<Child>§selection: Selection§conn: ConnectParams

Implementations§

source§

impl Directory

source

pub fn diff(&self, other: DirectoryId) -> Directory

Gets the difference between this directory and an another directory.

Arguments
  • other - Identifier of the directory to compare.
source

pub fn directory(&self, path: impl Into<String>) -> Directory

Retrieves a directory at the given path.

Arguments
  • path - Location of the directory to retrieve (e.g., “/src”).
source

pub fn docker_build(&self) -> Container

Builds a new Docker container from this directory.

Arguments
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn docker_build_opts<'a>( &self, opts: DirectoryDockerBuildOpts<'a> ) -> Container

Builds a new Docker container from this directory.

Arguments
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub async fn entries(&self) -> Result<Vec<String>>

Returns a list of files and directories at the given path.

Arguments
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub async fn entries_opts<'a>( &self, opts: DirectoryEntriesOpts<'a> ) -> Result<Vec<String>>

Returns a list of files and directories at the given path.

Arguments
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub async fn export(&self, path: impl Into<String>) -> Result<bool>

Writes the contents of the directory to a path on the host.

Arguments
  • path - Location of the copied directory (e.g., “logs/”).
source

pub fn file(&self, path: impl Into<String>) -> File

Retrieves a file at the given path.

Arguments
  • path - Location of the file to retrieve (e.g., “README.md”).
source

pub async fn id(&self) -> Result<DirectoryId>

The content-addressed identifier of the directory.

source

pub fn load_project(&self, config_path: impl Into<String>) -> Project

load a project’s metadata

source

pub fn pipeline(&self, name: impl Into<String>) -> Directory

Creates a named sub-pipeline

Arguments
  • name - Pipeline name.
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn pipeline_opts<'a>( &self, name: impl Into<String>, opts: DirectoryPipelineOpts<'a> ) -> Directory

Creates a named sub-pipeline

Arguments
  • name - Pipeline name.
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn with_directory( &self, path: impl Into<String>, directory: DirectoryId ) -> Directory

Retrieves this directory plus a directory written at the given path.

Arguments
  • path - Location of the written directory (e.g., “/src/”).
  • directory - Identifier of the directory to copy.
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn with_directory_opts<'a>( &self, path: impl Into<String>, directory: DirectoryId, opts: DirectoryWithDirectoryOpts<'a> ) -> Directory

Retrieves this directory plus a directory written at the given path.

Arguments
  • path - Location of the written directory (e.g., “/src/”).
  • directory - Identifier of the directory to copy.
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn with_file(&self, path: impl Into<String>, source: FileId) -> Directory

Retrieves this directory plus the contents of the given file copied to the given path.

Arguments
  • path - Location of the copied file (e.g., “/file.txt”).
  • source - Identifier of the file to copy.
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn with_file_opts( &self, path: impl Into<String>, source: FileId, opts: DirectoryWithFileOpts ) -> Directory

Retrieves this directory plus the contents of the given file copied to the given path.

Arguments
  • path - Location of the copied file (e.g., “/file.txt”).
  • source - Identifier of the file to copy.
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn with_new_directory(&self, path: impl Into<String>) -> Directory

Retrieves this directory plus a new directory created at the given path.

Arguments
  • path - Location of the directory created (e.g., “/logs”).
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn with_new_directory_opts( &self, path: impl Into<String>, opts: DirectoryWithNewDirectoryOpts ) -> Directory

Retrieves this directory plus a new directory created at the given path.

Arguments
  • path - Location of the directory created (e.g., “/logs”).
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn with_new_file( &self, path: impl Into<String>, contents: impl Into<String> ) -> Directory

Retrieves this directory plus a new file written at the given path.

Arguments
  • path - Location of the written file (e.g., “/file.txt”).
  • contents - Content of the written file (e.g., “Hello world!”).
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn with_new_file_opts( &self, path: impl Into<String>, contents: impl Into<String>, opts: DirectoryWithNewFileOpts ) -> Directory

Retrieves this directory plus a new file written at the given path.

Arguments
  • path - Location of the written file (e.g., “/file.txt”).
  • contents - Content of the written file (e.g., “Hello world!”).
  • opt - optional argument, see inner type for documentation, use _opts to use
source

pub fn with_timestamps(&self, timestamp: isize) -> Directory

Retrieves this directory with all file/dir timestamps set to the given time.

Arguments
  • timestamp - Timestamp to set dir/files in.

Formatted in seconds following Unix epoch (e.g., 1672531199).

source

pub fn without_directory(&self, path: impl Into<String>) -> Directory

Retrieves this directory with the directory at the given path removed.

Arguments
  • path - Location of the directory to remove (e.g., “.github/”).
source

pub fn without_file(&self, path: impl Into<String>) -> Directory

Retrieves this directory with the file at the given path removed.

Arguments
  • path - Location of the file to remove (e.g., “/file.txt”).

Trait Implementations§

source§

impl Clone for Directory

source§

fn clone(&self) -> Directory

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Directory

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more