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_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
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 fn blueprint(&self) -> ModuleSource
pub fn blueprint(&self) -> ModuleSource
The blueprint referenced by the module source.
Sourcepub async fn clone_ref(&self) -> Result<String, DaggerError>
pub async fn clone_ref(&self) -> Result<String, DaggerError>
The ref to clone the root of the git repo from. Only valid for git sources.
Sourcepub async fn commit(&self) -> Result<String, DaggerError>
pub async fn commit(&self) -> Result<String, DaggerError>
The resolved commit of the git repo this source points to.
Sourcepub fn config_clients(&self) -> Vec<ModuleConfigClient>
pub fn config_clients(&self) -> Vec<ModuleConfigClient>
The clients generated for the module.
Sourcepub async fn config_exists(&self) -> Result<bool, DaggerError>
pub async fn config_exists(&self) -> Result<bool, DaggerError>
Whether an existing dagger.json for the module was found.
Sourcepub fn context_directory(&self) -> Directory
pub fn context_directory(&self) -> Directory
The full directory loaded for the module source, including the source code as a subdirectory.
Sourcepub fn dependencies(&self) -> Vec<ModuleSource>
pub fn dependencies(&self) -> Vec<ModuleSource>
The dependencies of the module source.
Sourcepub async fn digest(&self) -> Result<String, DaggerError>
pub async fn digest(&self) -> Result<String, DaggerError>
A content-hash of the module source. Module sources with the same digest will output the same generated context and convert into the same module instance.
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- A subpath from the source directory to select.
Sourcepub async fn engine_version(&self) -> Result<String, DaggerError>
pub async fn engine_version(&self) -> Result<String, DaggerError>
The engine version of the module.
Sourcepub fn generated_context_directory(&self) -> Directory
pub fn generated_context_directory(&self) -> Directory
The generated files and directories made on top of the module source’s context directory.
Sourcepub async fn html_repo_url(&self) -> Result<String, DaggerError>
pub async fn html_repo_url(&self) -> Result<String, DaggerError>
The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
Sourcepub async fn html_url(&self) -> Result<String, DaggerError>
pub async fn html_url(&self) -> Result<String, DaggerError>
The URL to the source’s git repo in a web browser. Only valid for git sources.
Sourcepub async fn id(&self) -> Result<ModuleSourceId, DaggerError>
pub async fn id(&self) -> Result<ModuleSourceId, DaggerError>
A unique identifier for this ModuleSource.
Sourcepub fn introspection_schema_json(&self) -> File
pub fn introspection_schema_json(&self) -> File
The introspection schema JSON file for this module source. This file represents the schema visible to the module’s source code, including all core types and those from the dependencies. Note: this is in the context of a module, so some core types may be hidden.
Sourcepub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError>
pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError>
The kind of module source (currently local, git or dir).
Sourcepub async fn local_context_directory_path(&self) -> Result<String, DaggerError>
pub async fn local_context_directory_path(&self) -> Result<String, DaggerError>
The full absolute path to the context directory on the caller’s host filesystem that this module source is loaded from. Only valid for local module sources.
Sourcepub async fn module_name(&self) -> Result<String, DaggerError>
pub async fn module_name(&self) -> Result<String, DaggerError>
The name of the module, including any setting via the withName API.
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 as read from the module’s dagger.json (or set for the first time with the withName API).
Sourcepub async fn original_subpath(&self) -> Result<String, DaggerError>
pub async fn original_subpath(&self) -> Result<String, DaggerError>
The original subpath used when instantiating this module source, relative to the context directory.
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 repo_root_path(&self) -> Result<String, DaggerError>
pub async fn repo_root_path(&self) -> Result<String, DaggerError>
The import path corresponding to the root of the git repo this source points to. Only valid for git 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 the context directory, that contains the module’s dagger.json.
Sourcepub async fn source_subpath(&self) -> Result<String, DaggerError>
pub async fn source_subpath(&self) -> Result<String, DaggerError>
The path to the directory containing the module’s source code, relative to the context directory.
Sourcepub async fn sync(&self) -> Result<ModuleSourceId, DaggerError>
pub async fn sync(&self) -> Result<ModuleSourceId, DaggerError>
Forces evaluation of the module source, including any loading into the engine and associated validation.
Sourcepub fn toolchains(&self) -> Vec<ModuleSource>
pub fn toolchains(&self) -> Vec<ModuleSource>
The toolchains referenced by the module source.
Sourcepub fn user_defaults(&self) -> EnvFile
pub fn user_defaults(&self) -> EnvFile
User-defined defaults read from local .env files
Sourcepub async fn version(&self) -> Result<String, DaggerError>
pub async fn version(&self) -> Result<String, DaggerError>
The specified version of the git repo this source points to.
Sourcepub fn with_blueprint(
&self,
blueprint: impl IntoID<ModuleSourceId>,
) -> ModuleSource
pub fn with_blueprint( &self, blueprint: impl IntoID<ModuleSourceId>, ) -> ModuleSource
Sourcepub fn with_client(
&self,
generator: impl Into<String>,
output_dir: impl Into<String>,
) -> ModuleSource
pub fn with_client( &self, generator: impl Into<String>, output_dir: impl Into<String>, ) -> ModuleSource
Update the module source with a new client to generate.
§Arguments
generator- The generator to useoutput_dir- The output directory for the generated client.
Sourcepub fn with_dependencies(
&self,
dependencies: Vec<ModuleSourceId>,
) -> ModuleSource
pub fn with_dependencies( &self, dependencies: Vec<ModuleSourceId>, ) -> ModuleSource
Append the provided dependencies to the module source’s dependency list.
§Arguments
dependencies- The dependencies to append.
Sourcepub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource
pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource
Upgrade the engine version of the module to the given value.
§Arguments
version- The engine version to upgrade to.
Sourcepub fn with_experimental_features(
&self,
features: Vec<ModuleSourceExperimentalFeature>,
) -> ModuleSource
pub fn with_experimental_features( &self, features: Vec<ModuleSourceExperimentalFeature>, ) -> ModuleSource
Enable the experimental features for the module source.
§Arguments
features- The experimental features to enable.
Sourcepub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource
pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource
Update the module source with additional include patterns for files+directories from its context that are required for building it
§Arguments
patterns- The new additional include patterns.
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. Must be relative to the module source’s source root directory.
Sourcepub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource
pub fn with_toolchains(&self, toolchains: Vec<ModuleSourceId>) -> ModuleSource
Sourcepub fn with_update_blueprint(&self) -> ModuleSource
pub fn with_update_blueprint(&self) -> ModuleSource
Update the blueprint module to the latest version.
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_update_toolchains(
&self,
toolchains: Vec<impl Into<String>>,
) -> ModuleSource
pub fn with_update_toolchains( &self, toolchains: Vec<impl Into<String>>, ) -> ModuleSource
Sourcepub fn with_updated_clients(
&self,
clients: Vec<impl Into<String>>,
) -> ModuleSource
pub fn with_updated_clients( &self, clients: Vec<impl Into<String>>, ) -> ModuleSource
Sourcepub fn without_blueprint(&self) -> ModuleSource
pub fn without_blueprint(&self) -> ModuleSource
Remove the current blueprint from the module source.
Sourcepub fn without_client(&self, path: impl Into<String>) -> ModuleSource
pub fn without_client(&self, path: impl Into<String>) -> ModuleSource
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.
Sourcepub fn without_experimental_features(
&self,
features: Vec<ModuleSourceExperimentalFeature>,
) -> ModuleSource
pub fn without_experimental_features( &self, features: Vec<ModuleSourceExperimentalFeature>, ) -> ModuleSource
Disable experimental features for the module source.
§Arguments
features- The experimental features to disable.
Sourcepub fn without_toolchains(
&self,
toolchains: Vec<impl Into<String>>,
) -> ModuleSource
pub fn without_toolchains( &self, toolchains: Vec<impl Into<String>>, ) -> ModuleSource
Remove the provided toolchains from the module source.
§Arguments
toolchains- The toolchains 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