Function downcast_value

Source
fn downcast_value<I: Any, O: Sized + 'static>(input: I) -> Result<O, I>
Expand description

Try to cast I (which is presumably a TAIT) to O (presumably a concrete type)

We use runtime casting, but typically the answer is known at compile time.

Astonishingly, this isn’t in any of the following:

  • std
  • match-downcast
  • better_any (downcast:move comes close but doesn’t give you your self back)
  • castaway
  • mopa
  • as_any