use sitemap_rs::image::Image; use sitemap_rs::url::Url; use sitemap_rs::url_set::UrlSet; fn main() { let urls: Vec = vec![ Url::builder(String::from("http://example.com/sample1.html")) .images(vec![ Image::new(String::from("http://example.com/image.jpg")), Image::new(String::from("http://example.com/photo.jpg")), ]) .build() .expect("failed a validation"), Url::builder(String::from("http://example.com/sample2.html")) .images(vec![Image::new(String::from( "http://example.com/picture.jpg", ))]) .build() .expect("failed a validation"), ]; let url_set: UrlSet = UrlSet::new(urls).expect("failed a validation"); let mut buf = Vec::::new(); url_set.write(&mut buf).unwrap(); }