Struct dagger_sdk::Directory
source · pub struct Directory {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}Fields§
§proc: Option<Arc<DaggerSessionProc>>§selection: Selection§graphql_client: DynGraphQLClientImplementations§
source§impl Directory
impl Directory
sourcepub fn as_module(&self) -> Module
pub fn as_module(&self) -> Module
Load the directory as a Dagger module
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module
pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module
Load the directory as a Dagger module
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory
pub fn diff(&self, other: impl IntoID<DirectoryId>) -> Directory
Gets the difference between this directory and an another directory.
§Arguments
other- Identifier of the directory to compare.
sourcepub fn directory(&self, path: impl Into<String>) -> Directory
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”).
sourcepub fn docker_build(&self) -> Container
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
sourcepub fn docker_build_opts<'a>(
&self,
opts: DirectoryDockerBuildOpts<'a>,
) -> Container
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
sourcepub async fn entries(&self) -> Result<Vec<String>, DaggerError>
pub async fn entries(&self) -> Result<Vec<String>, DaggerError>
Returns a list of files and directories at the given path.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub async fn entries_opts<'a>(
&self,
opts: DirectoryEntriesOpts<'a>,
) -> Result<Vec<String>, DaggerError>
pub async fn entries_opts<'a>( &self, opts: DirectoryEntriesOpts<'a>, ) -> Result<Vec<String>, DaggerError>
Returns a list of files and directories at the given path.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub async fn export(
&self,
path: impl Into<String>,
) -> Result<String, DaggerError>
pub async fn export( &self, path: impl Into<String>, ) -> Result<String, DaggerError>
Writes the contents of the directory to a path on the host.
§Arguments
path- Location of the copied directory (e.g., “logs/”).opt- optional argument, see inner type for documentation, use_opts to use
sourcepub async fn export_opts(
&self,
path: impl Into<String>,
opts: DirectoryExportOpts,
) -> Result<String, DaggerError>
pub async fn export_opts( &self, path: impl Into<String>, opts: DirectoryExportOpts, ) -> Result<String, DaggerError>
Writes the contents of the directory to a path on the host.
§Arguments
path- Location of the copied directory (e.g., “logs/”).opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn file(&self, path: impl Into<String>) -> File
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”).
sourcepub async fn glob(
&self,
pattern: impl Into<String>,
) -> Result<Vec<String>, DaggerError>
pub async fn glob( &self, pattern: impl Into<String>, ) -> Result<Vec<String>, DaggerError>
Returns a list of files and directories that matche the given pattern.
§Arguments
pattern- Pattern to match (e.g., “*.md”).
sourcepub async fn id(&self) -> Result<DirectoryId, DaggerError>
pub async fn id(&self) -> Result<DirectoryId, DaggerError>
A unique identifier for this Directory.
sourcepub fn pipeline(&self, name: impl Into<String>) -> Directory
pub fn pipeline(&self, name: impl Into<String>) -> Directory
Creates a named sub-pipeline.
§Arguments
name- Name of the sub-pipeline.opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn pipeline_opts<'a>(
&self,
name: impl Into<String>,
opts: DirectoryPipelineOpts<'a>,
) -> Directory
pub fn pipeline_opts<'a>( &self, name: impl Into<String>, opts: DirectoryPipelineOpts<'a>, ) -> Directory
Creates a named sub-pipeline.
§Arguments
name- Name of the sub-pipeline.opt- optional argument, see inner type for documentation, use_opts to use
sourcepub async fn sync(&self) -> Result<DirectoryId, DaggerError>
pub async fn sync(&self) -> Result<DirectoryId, DaggerError>
Force evaluation in the engine.
sourcepub fn terminal(&self) -> Directory
pub fn terminal(&self) -> Directory
Opens an interactive terminal in new container with this directory mounted inside.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory
pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory
Opens an interactive terminal in new container with this directory mounted inside.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn with_directory(
&self,
path: impl Into<String>,
directory: impl IntoID<DirectoryId>,
) -> Directory
pub fn with_directory( &self, path: impl Into<String>, directory: impl IntoID<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
sourcepub fn with_directory_opts<'a>(
&self,
path: impl Into<String>,
directory: impl IntoID<DirectoryId>,
opts: DirectoryWithDirectoryOpts<'a>,
) -> Directory
pub fn with_directory_opts<'a>( &self, path: impl Into<String>, directory: impl IntoID<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
sourcepub fn with_file(
&self,
path: impl Into<String>,
source: impl IntoID<FileId>,
) -> Directory
pub fn with_file( &self, path: impl Into<String>, source: impl IntoID<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
sourcepub fn with_file_opts(
&self,
path: impl Into<String>,
source: impl IntoID<FileId>,
opts: DirectoryWithFileOpts,
) -> Directory
pub fn with_file_opts( &self, path: impl Into<String>, source: impl IntoID<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
sourcepub fn with_files(
&self,
path: impl Into<String>,
sources: Vec<FileId>,
) -> Directory
pub fn with_files( &self, path: impl Into<String>, sources: Vec<FileId>, ) -> Directory
Retrieves this directory plus the contents of the given files copied to the given path.
§Arguments
path- Location where copied files should be placed (e.g., “/src”).sources- Identifiers of the files to copy.opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn with_files_opts(
&self,
path: impl Into<String>,
sources: Vec<FileId>,
opts: DirectoryWithFilesOpts,
) -> Directory
pub fn with_files_opts( &self, path: impl Into<String>, sources: Vec<FileId>, opts: DirectoryWithFilesOpts, ) -> Directory
Retrieves this directory plus the contents of the given files copied to the given path.
§Arguments
path- Location where copied files should be placed (e.g., “/src”).sources- Identifiers of the files to copy.opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn with_new_directory(&self, path: impl Into<String>) -> Directory
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
sourcepub fn with_new_directory_opts(
&self,
path: impl Into<String>,
opts: DirectoryWithNewDirectoryOpts,
) -> Directory
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
sourcepub fn with_new_file(
&self,
path: impl Into<String>,
contents: impl Into<String>,
) -> Directory
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
sourcepub fn with_new_file_opts(
&self,
path: impl Into<String>,
contents: impl Into<String>,
opts: DirectoryWithNewFileOpts,
) -> Directory
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
sourcepub fn with_timestamps(&self, timestamp: isize) -> Directory
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).
Trait Implementations§
source§impl IntoID<DirectoryId> for Directory
impl IntoID<DirectoryId> for Directory
fn into_id( self, ) -> Pin<Box<dyn Future<Output = Result<DirectoryId, DaggerError>> + Send>>
Auto Trait Implementations§
impl Freeze for Directory
impl !RefUnwindSafe for Directory
impl Send for Directory
impl Sync for Directory
impl Unpin for Directory
impl !UnwindSafe for Directory
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)