mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-03 14:23:26 +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:
@@ -7,15 +7,12 @@ fn main() -> eyre::Result<()> {
|
||||
|
||||
let context_dir = client
|
||||
.host()
|
||||
.directory("./examples/existing-dockerfile/app", None);
|
||||
.directory("./examples/existing-dockerfile/app");
|
||||
|
||||
let ref_ = client
|
||||
.container(None)
|
||||
.build(context_dir.id()?, None)
|
||||
.publish(
|
||||
format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()),
|
||||
None,
|
||||
)?;
|
||||
.container()
|
||||
.build(context_dir.id()?)
|
||||
.publish(format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()))?;
|
||||
|
||||
println!("published image to: {}", ref_);
|
||||
|
||||
|
Reference in New Issue
Block a user