Dagger
Search

rust

Rust programming language module.

Installation

dagger install github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155

Entrypoint

Return Type
Rust !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-Source directory.
components[String ! ] -Components to install.
targets[String ! ] -Targets to install.
versionString -Version (image tag) to use from the official image repository as a base container.
containerContainer -Custom container to use as a base container.
disableCacheBoolean -Disable mounting cache volumes.
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH
func (m *MyModule) Example(source *dagger.Directory) *dagger.Rust  {
	return dag.
			Rust(source)
}
@function
def example(source: dagger.Directory, ) -> dagger.Rust:
	return (
		dag.rust(source)
	)
@func()
example(source: Directory, ): Rust {
	return dag
		.rust(source)
}

Types

Rust 🔗

source() 🔗

Return Type
Directory !
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH source
func (m *MyModule) Example(source *dagger.Directory) *dagger.Directory  {
	return dag.
			Rust(source).
			Source()
}
@function
def example(source: dagger.Directory, ) -> dagger.Directory:
	return (
		dag.rust(source)
		.source()
	)
@func()
example(source: Directory, ): Directory {
	return dag
		.rust(source)
		.source()
}

withRegistryCache() 🔗

Mount a cache volume for Cargo registry cache.

Return Type
Rust !
Arguments
NameTypeDefault ValueDescription
cacheCacheVolume !-No description provided
sourceDirectory -Identifier of the directory to use as the cache volume's root.
sharingEnum -Sharing mode of the cache volume.
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH with-registry-cache --cache VOLUME_NAME
func (m *MyModule) Example(source *dagger.Directory, cache *dagger.CacheVolume) *dagger.Rust  {
	return dag.
			Rust(source).
			WithRegistryCache(cache)
}
@function
def example(source: dagger.Directory, cache: dagger.CacheVolume) -> dagger.Rust:
	return (
		dag.rust(source)
		.with_registry_cache(cache)
	)
@func()
example(source: Directory, cache: CacheVolume): Rust {
	return dag
		.rust(source)
		.withRegistryCache(cache)
}

withGitCache() 🔗

Mount a cache volume for Cargo git cache.

Return Type
Rust !
Arguments
NameTypeDefault ValueDescription
cacheCacheVolume !-No description provided
sourceDirectory -Identifier of the directory to use as the cache volume's root.
sharingEnum -Sharing mode of the cache volume.
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH with-git-cache --cache VOLUME_NAME
func (m *MyModule) Example(source *dagger.Directory, cache *dagger.CacheVolume) *dagger.Rust  {
	return dag.
			Rust(source).
			WithGitCache(cache)
}
@function
def example(source: dagger.Directory, cache: dagger.CacheVolume) -> dagger.Rust:
	return (
		dag.rust(source)
		.with_git_cache(cache)
	)
@func()
example(source: Directory, cache: CacheVolume): Rust {
	return dag
		.rust(source)
		.withGitCache(cache)
}

withChef() 🔗

Mount a cache volume for Cargo registry cache.

Return Type
Rust !
Arguments
NameTypeDefault ValueDescription
versionString -Version of cargo-chef to install.
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH with-chef
func (m *MyModule) Example(source *dagger.Directory) *dagger.Rust  {
	return dag.
			Rust(source).
			WithChef()
}
@function
def example(source: dagger.Directory, ) -> dagger.Rust:
	return (
		dag.rust(source)
		.with_chef()
	)
@func()
example(source: Directory, ): Rust {
	return dag
		.rust(source)
		.withChef()
}

build() 🔗

Compile a local package and all of its dependencies.

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
pkgString -Package to build.
features[String ! ] -List of features to activate.
allFeaturesBoolean -Activate all available features.
noDefaultFeaturesBoolean -Do not activate the `default` feature.
releaseBoolean -Build artifacts in release mode, with optimizations.
profileString -Build artifacts with the specified profile.
targetString -Build for the target triple.
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH build
func (m *MyModule) Example(source *dagger.Directory) *dagger.Directory  {
	return dag.
			Rust(source).
			Build()
}
@function
def example(source: dagger.Directory, ) -> dagger.Directory:
	return (
		dag.rust(source)
		.build()
	)
@func()
example(source: Directory, ): Directory {
	return dag
		.rust(source)
		.build()
}

test() 🔗

Execute all unit and integration tests and build examples of a local package.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
testNameString -If specified, only run tests containing this string in their names.
args[String ! ] -Arguments for the test binary.
pkgString -Package to build.
features[String ! ] -List of features to activate.
allFeaturesBoolean -Activate all available features.
noDefaultFeaturesBoolean -Do not activate the `default` feature.
releaseBoolean -Build artifacts in release mode, with optimizations.
profileString -Build artifacts with the specified profile.
targetString -Build for the target triple.
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH test
func (m *MyModule) Example(source *dagger.Directory) *dagger.Container  {
	return dag.
			Rust(source).
			Test()
}
@function
def example(source: dagger.Directory, ) -> dagger.Container:
	return (
		dag.rust(source)
		.test()
	)
@func()
example(source: Directory, ): Container {
	return dag
		.rust(source)
		.test()
}

check() 🔗

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
pkgString -Package to build.
features[String ! ] -List of features to activate.
allFeaturesBoolean -Activate all available features.
noDefaultFeaturesBoolean -Do not activate the `default` feature.
releaseBoolean -Build artifacts in release mode, with optimizations.
profileString -Build artifacts with the specified profile.
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH check
func (m *MyModule) Example(source *dagger.Directory) *dagger.Container  {
	return dag.
			Rust(source).
			Check()
}
@function
def example(source: dagger.Directory, ) -> dagger.Container:
	return (
		dag.rust(source)
		.check()
	)
@func()
example(source: Directory, ): Container {
	return dag
		.rust(source)
		.check()
}

format() 🔗

This utility formats all bin and lib files of the current crate using rustfmt.

Return Type
Format !
Arguments
NameTypeDefault ValueDescription
pkgString -Specify package to format.
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH format
func (m *MyModule) Example(source *dagger.Directory) *dagger.RustFormat  {
	return dag.
			Rust(source).
			Format()
}
@function
def example(source: dagger.Directory, ) -> dagger.RustFormat:
	return (
		dag.rust(source)
		.format()
	)
@func()
example(source: Directory, ): RustFormat {
	return dag
		.rust(source)
		.format()
}

clippy() 🔗

Checks a package to catch common mistakes and improve your Rust code.

Return Type
Clippy !
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 --source DIR_PATH clippy
func (m *MyModule) Example(source *dagger.Directory) *dagger.RustClippy  {
	return dag.
			Rust(source).
			Clippy()
}
@function
def example(source: dagger.Directory, ) -> dagger.RustClippy:
	return (
		dag.rust(source)
		.clippy()
	)
@func()
example(source: Directory, ): RustClippy {
	return dag
		.rust(source)
		.clippy()
}

Format 🔗

run() 🔗

Format code.

Return Type
Changeset !
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 format \
 run
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			Rust().
			Format().
			Run()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.rust()
		.format()
		.run()
	)
@func()
example(): Changeset {
	return dag
		.rust()
		.format()
		.run()
}

check() 🔗

Run in check mode.

Return Type
Container !
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 format \
 check
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Rust().
			Format().
			Check()
}
@function
def example() -> dagger.Container:
	return (
		dag.rust()
		.format()
		.check()
	)
@func()
example(): Container {
	return dag
		.rust()
		.format()
		.check()
}

Clippy 🔗

run() 🔗

Run checks.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
noDepsBoolean -Run Clippy only on the given crate, without linting the dependencies.
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 clippy \
 run
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Rust().
			Clippy().
			Run()
}
@function
def example() -> dagger.Container:
	return (
		dag.rust()
		.clippy()
		.run()
	)
@func()
example(): Container {
	return dag
		.rust()
		.clippy()
		.run()
}

fix() 🔗

Fix checks.

Return Type
Changeset !
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@5dcc7e4c4cd5ed230046955f42e27f2166545155 call \
 clippy \
 fix
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			Rust().
			Clippy().
			Fix()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.rust()
		.clippy()
		.fix()
	)
@func()
example(): Changeset {
	return dag
		.rust()
		.clippy()
		.fix()
}