//! The connection side of the per-agent icon KV bucket: opening it. The //! bucket's name, media type and subject are `swarm_wire::agent_icon`. /// Open the agent-icon bucket, creating it if nothing has yet. /// /// `history: 1`, same rationale as [`crate::agent_status::open_or_create`]: /// a consumer wants each agent's current icon, not every icon it has ever /// had. #[cfg(feature = "kv")] pub async fn open_or_create( client: &async_nats::Client, ) -> Result { let js = async_nats::jetstream::new(client.clone()); crate::kv::open_or_create( &js, swarm_wire::agent_icon::BUCKET, "agent-icon", "Current icon published by each agent".to_owned(), ) .await }