Macro s3_path_buf

Source
macro_rules! s3_path_buf {
    ($($component:expr),*) => { ... };
}
Expand description

Var-arg macro to create an S3Path from individual components.

use std::borrow::Cow;
use s3_path::s3_path_buf;

let path = s3_path_buf!("foo", String::from("bar"), Cow::Borrowed("baz")).unwrap();

Every component passed into this macro must either

  • be a &'static str
  • an owned String
  • or a Cow<'static, str>

str-slices of arbitrary lifetime cannot be used, as an S3PathBuf requires ownership, and this API enforces that any allocation, if needed, is performed at call-site.