use std::sync::Arc; pub struct RustPublish { client: Arc, } impl RustPublish { pub fn new(client: Arc) -> Self { Self { client } } pub async fn publish( &self, image: impl Into, tag: impl Into, containers: impl IntoIterator, ) -> eyre::Result<()> { let mut ids = Vec::new(); for container in containers.into_iter() { let id = container.id().await?; ids.push(id); } let image = self .client .container() .publish_opts( format!("{}:{}", image.into(), tag.into()), dagger_sdk::ContainerPublishOpts { platform_variants: Some(ids), forced_compression: None, media_types: None, }, ) .await?; println!("published: {}", image); Ok(()) } }