mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-07-25 19:09:22 +02:00
feat(sdk): with _opts methods
Now all opt values enter into a _opts function instead of the original. This avoids a lot of verbosity for both None in the case opts are unwanted, and Some() if they actually are. They are used like so: ```rust client.container().from("..."); client.container_opts(Some(ContainerOpts{ ... })) ``` Some from opts will be removed in a future commit/pr
This commit is contained in:
@@ -4,10 +4,10 @@ use dagger_sdk::{connect, ContainerExecOptsBuilder};
|
||||
fn test_example_container() {
|
||||
let client = connect().unwrap();
|
||||
|
||||
let alpine = client.container(None).from("alpine:3.16.2");
|
||||
let alpine = client.container().from("alpine:3.16.2");
|
||||
|
||||
let out = alpine
|
||||
.exec(Some(
|
||||
.exec_opts(Some(
|
||||
ContainerExecOptsBuilder::default()
|
||||
.args(vec!["cat", "/etc/alpine-release"])
|
||||
.build()
|
||||
|
Reference in New Issue
Block a user