pub struct ModuleSource {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}Fields§
§proc: Option<Arc<DaggerSessionProc>>§selection: Selection§graphql_client: DynGraphQLClientImplementations§
Source§impl ModuleSource
impl ModuleSource
Sourcepub fn as_git_source(&self) -> GitModuleSource
pub fn as_git_source(&self) -> GitModuleSource
If the source is a of kind git, the git source representation of it.
Sourcepub fn as_local_source(&self) -> LocalModuleSource
pub fn as_local_source(&self) -> LocalModuleSource
If the source is of kind local, the local source representation of it.
Sourcepub fn as_module(&self) -> Module
pub fn as_module(&self) -> Module
Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn as_module_opts<'a>(&self, opts: ModuleSourceAsModuleOpts<'a>) -> Module
pub fn as_module_opts<'a>(&self, opts: ModuleSourceAsModuleOpts<'a>) -> Module
Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn as_string(&self) -> Result<String, DaggerError>
pub async fn as_string(&self) -> Result<String, DaggerError>
A human readable ref string representation of this module source.
Sourcepub async fn config_exists(&self) -> Result<bool, DaggerError>
pub async fn config_exists(&self) -> Result<bool, DaggerError>
Returns whether the module source has a configuration file.
Sourcepub fn context_directory(&self) -> Directory
pub fn context_directory(&self) -> Directory
The directory containing everything needed to load and use the module.
Sourcepub fn dependencies(&self) -> Vec<ModuleDependency>
pub fn dependencies(&self) -> Vec<ModuleDependency>
The effective module source dependencies from the configuration, and calls to withDependencies and withoutDependencies.
Sourcepub async fn digest(&self) -> Result<String, DaggerError>
pub async fn digest(&self) -> Result<String, DaggerError>
Return the module source’s content digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
Sourcepub fn directory(&self, path: impl Into<String>) -> Directory
pub fn directory(&self, path: impl Into<String>) -> Directory
The directory containing the module configuration and source code (source code may be in a subdir).
§Arguments
path- The path from the source directory to select.
Sourcepub async fn id(&self) -> Result<ModuleSourceId, DaggerError>
pub async fn id(&self) -> Result<ModuleSourceId, DaggerError>
A unique identifier for this ModuleSource.
Sourcepub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError>
pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError>
The kind of source (e.g. local, git, etc.)
Sourcepub async fn module_name(&self) -> Result<String, DaggerError>
pub async fn module_name(&self) -> Result<String, DaggerError>
If set, the name of the module this source references, including any overrides at runtime by callers.
Sourcepub async fn module_original_name(&self) -> Result<String, DaggerError>
pub async fn module_original_name(&self) -> Result<String, DaggerError>
The original name of the module this source references, as defined in the module configuration.
Sourcepub async fn pin(&self) -> Result<String, DaggerError>
pub async fn pin(&self) -> Result<String, DaggerError>
The pinned version of this module source.
Sourcepub async fn resolve_context_path_from_caller(
&self,
) -> Result<String, DaggerError>
pub async fn resolve_context_path_from_caller( &self, ) -> Result<String, DaggerError>
The path to the module source’s context directory on the caller’s filesystem. Only valid for local sources.
Sourcepub fn resolve_dependency(
&self,
dep: impl IntoID<ModuleSourceId>,
) -> ModuleSource
pub fn resolve_dependency( &self, dep: impl IntoID<ModuleSourceId>, ) -> ModuleSource
Resolve the provided module source arg as a dependency relative to this module source.
§Arguments
dep- The dependency module source to resolve.
Sourcepub fn resolve_directory_from_caller(
&self,
path: impl Into<String>,
) -> Directory
pub fn resolve_directory_from_caller( &self, path: impl Into<String>, ) -> Directory
Load a directory from the caller optionally with a given view applied.
§Arguments
path- The path on the caller’s filesystem to load.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn resolve_directory_from_caller_opts<'a>(
&self,
path: impl Into<String>,
opts: ModuleSourceResolveDirectoryFromCallerOpts<'a>,
) -> Directory
pub fn resolve_directory_from_caller_opts<'a>( &self, path: impl Into<String>, opts: ModuleSourceResolveDirectoryFromCallerOpts<'a>, ) -> Directory
Load a directory from the caller optionally with a given view applied.
§Arguments
path- The path on the caller’s filesystem to load.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn resolve_from_caller(&self) -> ModuleSource
pub fn resolve_from_caller(&self) -> ModuleSource
Load the source from its path on the caller’s filesystem, including only needed+configured files and directories. Only valid for local sources.
Sourcepub async fn source_root_subpath(&self) -> Result<String, DaggerError>
pub async fn source_root_subpath(&self) -> Result<String, DaggerError>
The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root.
Sourcepub async fn source_subpath(&self) -> Result<String, DaggerError>
pub async fn source_subpath(&self) -> Result<String, DaggerError>
The path relative to context of the module implementation source code.
Sourcepub fn view(&self, name: impl Into<String>) -> ModuleSourceView
pub fn view(&self, name: impl Into<String>) -> ModuleSourceView
Retrieve a named view defined for this module source.
§Arguments
name- The name of the view to retrieve.
Sourcepub fn views(&self) -> Vec<ModuleSourceView>
pub fn views(&self) -> Vec<ModuleSourceView>
The named views defined for this module source, which are sets of directory filters that can be applied to directory arguments provided to functions.
Sourcepub fn with_context_directory(
&self,
dir: impl IntoID<DirectoryId>,
) -> ModuleSource
pub fn with_context_directory( &self, dir: impl IntoID<DirectoryId>, ) -> ModuleSource
Update the module source with a new context directory. Only valid for local sources.
§Arguments
dir- The directory to set as the context directory.
Sourcepub fn with_dependencies(
&self,
dependencies: Vec<ModuleDependencyId>,
) -> ModuleSource
pub fn with_dependencies( &self, dependencies: Vec<ModuleDependencyId>, ) -> ModuleSource
Append the provided dependencies to the module source’s dependency list.
§Arguments
dependencies- The dependencies to append.
Sourcepub fn with_init(&self) -> ModuleSource
pub fn with_init(&self) -> ModuleSource
Sets module init arguments
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_init_opts(&self, opts: ModuleSourceWithInitOpts) -> ModuleSource
pub fn with_init_opts(&self, opts: ModuleSourceWithInitOpts) -> ModuleSource
Sets module init arguments
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_name(&self, name: impl Into<String>) -> ModuleSource
pub fn with_name(&self, name: impl Into<String>) -> ModuleSource
Sourcepub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource
pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource
Sourcepub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource
pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource
Update the module source with a new source subpath.
§Arguments
path- The path to set as the source subpath.
Sourcepub fn with_update_dependencies(
&self,
dependencies: Vec<impl Into<String>>,
) -> ModuleSource
pub fn with_update_dependencies( &self, dependencies: Vec<impl Into<String>>, ) -> ModuleSource
Sourcepub fn with_view(
&self,
name: impl Into<String>,
patterns: Vec<impl Into<String>>,
) -> ModuleSource
pub fn with_view( &self, name: impl Into<String>, patterns: Vec<impl Into<String>>, ) -> ModuleSource
Update the module source with a new named view.
§Arguments
name- The name of the view to set.patterns- The patterns to set as the view filters.
Sourcepub fn without_dependencies(
&self,
dependencies: Vec<impl Into<String>>,
) -> ModuleSource
pub fn without_dependencies( &self, dependencies: Vec<impl Into<String>>, ) -> ModuleSource
Remove the provided dependencies from the module source’s dependency list.
§Arguments
dependencies- The dependencies to remove.
Trait Implementations§
Source§impl Clone for ModuleSource
impl Clone for ModuleSource
Source§fn clone(&self) -> ModuleSource
fn clone(&self) -> ModuleSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more