Struct dagger_sdk::ModuleSource
source · 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 load and use the module.
sourcepub fn dependencies(&self) -> Vec<ModuleDependency>
pub fn dependencies(&self) -> Vec<ModuleDependency>
The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.
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 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_name(&self, name: impl Into<String>) -> ModuleSource
pub fn with_name(&self, name: impl Into<String>) -> ModuleSource
sourcepub fn with_sdk(&self, sdk: impl Into<String>) -> ModuleSource
pub fn with_sdk(&self, sdk: 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.
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 moresource§impl IntoID<ModuleSourceId> for ModuleSource
impl IntoID<ModuleSourceId> for ModuleSource
fn into_id( self, ) -> Pin<Box<dyn Future<Output = Result<ModuleSourceId, DaggerError>> + Send>>
Auto Trait Implementations§
impl Freeze for ModuleSource
impl !RefUnwindSafe for ModuleSource
impl Send for ModuleSource
impl Sync for ModuleSource
impl Unpin for ModuleSource
impl !UnwindSafe for ModuleSource
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)