trait_downcast_var
trait_downcast_var[T: Movable, //, Trait: AnyTrait[Movable]](var src: T) -> T(Trait)
Downcast a parameter input type T and rebind the type such that the return value's type conforms to the provided Trait. If T, after resolving to a concrete type, does not actually conform to Trait, a compilation error will occur.
Parameters:
- T (
Movable): The original type (inferred). - Trait (
AnyTrait): The trait to downcast into.
Args:
- src (
T): The value to downcast.
Returns:
T(Trait): The downcasted value.