Struct 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: DynGraphQLClient

Implementations§

Source§

impl ModuleSource

Source

pub fn as_git_source(&self) -> GitModuleSource

If the source is a of kind git, the git source representation of it.

Source

pub fn as_local_source(&self) -> LocalModuleSource

If the source is of kind local, the local source representation of it.

Source

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
Source

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
Source

pub async fn as_string(&self) -> Result<String, DaggerError>

A human readable ref string representation of this module source.

Source

pub async fn config_exists(&self) -> Result<bool, DaggerError>

Returns whether the module source has a configuration file.

Source

pub fn context_directory(&self) -> Directory

The directory containing everything needed to load and use the module.

Source

pub fn dependencies(&self) -> Vec<ModuleDependency>

The effective module source dependencies from the configuration, and calls to withDependencies and withoutDependencies.

Source

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.

Source

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.
Source

pub async fn id(&self) -> Result<ModuleSourceId, DaggerError>

A unique identifier for this ModuleSource.

Source

pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError>

The kind of source (e.g. local, git, etc.)

Source

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.

Source

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.

Source

pub async fn pin(&self) -> Result<String, DaggerError>

The pinned version of this module source.

Source

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.

Source

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.
Source

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
Source

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
Source

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.

Source

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.

Source

pub async fn source_subpath(&self) -> Result<String, DaggerError>

The path relative to context of the module implementation source code.

Source

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.
Source

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.

Source

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.
Source

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.
Source

pub fn with_init(&self) -> ModuleSource

Sets module init arguments

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

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
Source

pub fn with_name(&self, name: impl Into<String>) -> ModuleSource

Update the module source with a new name.

§Arguments
  • name - The name to set.
Source

pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource

Update the module source with a new SDK.

§Arguments
  • source - The SDK source to set.
Source

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.
Source

pub fn with_update_dependencies( &self, dependencies: Vec<impl Into<String>>, ) -> ModuleSource

Update one or more module dependencies.

§Arguments
  • dependencies - The dependencies to update.
Source

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.
Source

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

Source§

fn clone(&self) -> ModuleSource

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 IntoID<ModuleSourceId> for ModuleSource

Source§

fn into_id( self, ) -> Pin<Box<dyn Future<Output = Result<ModuleSourceId, DaggerError>> + Send>>

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

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 T
where U: From<T>,

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 for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
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