Macro cglue::into

source ·
into!() { /* proc-macro */ }
Expand description

Checked cast to a list of optional traits.

The syntax is similar to a cast expression, but uses impl keyword:

into!(obj impl Trait1 + Trait2 + Trait3);

into! is final. After invoking this conversion it is not possible to retrieve the original object.

This macro accepts either:

  1. A list of optional traits, without any mandatory traits.

or

  1. A list of optional traits, with every mandatory trait.

In either case a successfully cast object will still implement the mandatory traits.