rust
Rust programming language module.
Installation
dagger install github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680efEntrypoint
Return Type
Rust !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Source directory. |
| components | [String ! ] | - | Components to install. |
| targets | [String ! ] | - | Targets to install. |
| version | String | - | Version (image tag) to use from the official image repository as a base container. |
| container | Container | - | Custom container to use as a base container. |
| disableCache | Boolean | - | Disable mounting cache volumes. |
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATHfunc (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@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATH sourcefunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| cache | CacheVolume ! | - | No description provided |
| source | Directory | - | Identifier of the directory to use as the cache volume's root. |
| sharing | Enum | - | Sharing mode of the cache volume. |
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATH with-registry-cache --cache VOLUME_NAMEfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| cache | CacheVolume ! | - | No description provided |
| source | Directory | - | Identifier of the directory to use as the cache volume's root. |
| sharing | Enum | - | Sharing mode of the cache volume. |
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATH with-git-cache --cache VOLUME_NAMEfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | - | Version of cargo-chef to install. |
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATH with-cheffunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| pkg | String | - | Package to build. |
| features | [String ! ] | - | List of features to activate. |
| allFeatures | Boolean | - | Activate all available features. |
| noDefaultFeatures | Boolean | - | Do not activate the `default` feature. |
| release | Boolean | - | Build artifacts in release mode, with optimizations. |
| profile | String | - | Build artifacts with the specified profile. |
| target | String | - | Build for the target triple. |
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATH buildfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| testName | String | - | If specified, only run tests containing this string in their names. |
| args | [String ! ] | - | Arguments for the test binary. |
| pkg | String | - | Package to build. |
| features | [String ! ] | - | List of features to activate. |
| allFeatures | Boolean | - | Activate all available features. |
| noDefaultFeatures | Boolean | - | Do not activate the `default` feature. |
| release | Boolean | - | Build artifacts in release mode, with optimizations. |
| profile | String | - | Build artifacts with the specified profile. |
| target | String | - | Build for the target triple. |
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATH testfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| pkg | String | - | Package to build. |
| features | [String ! ] | - | List of features to activate. |
| allFeatures | Boolean | - | Activate all available features. |
| noDefaultFeatures | Boolean | - | Do not activate the `default` feature. |
| release | Boolean | - | Build artifacts in release mode, with optimizations. |
| profile | String | - | Build artifacts with the specified profile. |
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATH checkfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| pkg | String | - | Specify package to format. |
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATH formatfunc (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@950730d403bc032bb027e952f6313fca0a0680ef call \
--source DIR_PATH clippyfunc (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@950730d403bc032bb027e952f6313fca0a0680ef call \
format \
runfunc (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@950730d403bc032bb027e952f6313fca0a0680ef call \
format \
checkfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| noDeps | Boolean | - | Run Clippy only on the given crate, without linting the dependencies. |
Example
dagger -m github.com/sagikazarmark/daggerverse/rust@950730d403bc032bb027e952f6313fca0a0680ef call \
clippy \
runfunc (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@950730d403bc032bb027e952f6313fca0a0680ef call \
clippy \
fixfunc (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()
}