Trait variadics::CloneVariadic

source ·
pub trait CloneVariadic:
    VariadicExt
    + Clone
    + Sealed {
    // Required method
    fn clone_ref_var(this: Self::AsRefVar<'_>) -> Self;
}
Expand description

Clone a variadic of references AsRefVar into a variadic of owned values.

let ref_var = var_expr!(&1, &format!("hello {}", "world"), &vec![1, 2, 3]);
let clone_var = CloneVariadic::clone_ref_var(ref_var);
assert_eq!(
    var_expr!(1, "hello world".to_owned(), vec![1, 2, 3]),
    clone_var
);

Required Methods§

source

fn clone_ref_var(this: Self::AsRefVar<'_>) -> Self

Clone a variadic of references AsRefVar into a variadic of owned values.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl CloneVariadic for ()

source§

fn clone_ref_var(_this: Self::AsRefVar<'_>) -> Self

source§

impl<Item, Rest> CloneVariadic for (Item, Rest)
where Item: Clone, Rest: CloneVariadic,

source§

fn clone_ref_var(this: Self::AsRefVar<'_>) -> Self

Implementors§