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_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

Source

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

A human readable ref string representation of this module source.

Source

pub fn blueprint(&self) -> ModuleSource

The blueprint referenced by the module source.

Source

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.

Source

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

The resolved commit of the git repo this source points to.

Source

pub fn config_clients(&self) -> Vec<ModuleConfigClient>

The clients generated for the module.

Source

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

Whether an existing dagger.json for the module was found.

Source

pub fn context_directory(&self) -> Directory

The full directory loaded for the module source, including the source code as a subdirectory.

Source

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

The dependencies of the module source.

Source

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.

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 - A subpath from the source directory to select.
Source

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

The engine version of the module.

Source

pub fn generated_context_directory(&self) -> Directory

The generated files and directories made on top of the module source’s context directory.

Source

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

Source

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.

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 module source (currently local, git or dir).

Source

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.

Source

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

The name of the module, including any setting via the withName API.

Source

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

Source

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

The original subpath used when instantiating this module source, relative to the context directory.

Source

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

The pinned version of this module source.

Source

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.

Source

pub fn sdk(&self) -> SdkConfig

The SDK configuration of the module.

Source

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

The path, relative to the context directory, that contains the module’s dagger.json.

Source

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.

Source

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

Forces evaluation of the module source, including any loading into the engine and associated validation.

Source

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

The specified version of the git repo this source points to.

Source

pub fn with_blueprint( &self, blueprint: impl IntoID<ModuleSourceId>, ) -> ModuleSource

Set a blueprint for the module source.

§Arguments
  • blueprint - The blueprint module to set.
Source

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 use
  • output_dir - The output directory for the generated client.
Source

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

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

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.
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. Must be relative to the module source’s source root directory.
Source

pub fn with_update_blueprint(&self) -> ModuleSource

Update the blueprint module to the latest version.

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 without_blueprint(&self) -> ModuleSource

Remove the current blueprint from the module source.

Source

pub fn without_client(&self, path: impl Into<String>) -> ModuleSource

Remove a client from the module source.

§Arguments
  • path - The path of the client to remove.
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 duplicate 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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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
Source§

impl<T> ErasedDestructor for T
where T: 'static,