You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following up on #34 and #33, it would be nice if, when displaying the err field, if that object can be cast to Any, and that Any object into dyn Printable (via the trait_cast utility), then use that to print the field instead of just Display provided by thiserror.
Today, we try to downcast the err field to result::Error, and in that case, we can call Printable, but not for any other Rust type that implements Printable.
Note: result::Error::err has a as_any() method, but that's the Any object from the outer Box. What we want is (*self.err).as_any() to be used in ``impl Printable for Errorwhich doesn't work today becuasestd::error::Error` provides `downcast` but not `as_any`.
The text was updated successfully, but these errors were encountered:
Following up on #34 and #33, it would be nice if, when displaying the
err
field, if that object can be cast toAny
, and thatAny
object intodyn Printable
(via thetrait_cast
utility), then use that to print the field instead of justDisplay
provided bythiserror
.Today, we try to downcast the
err
field toresult::Error
, and in that case, we can callPrintable
, but not for any other Rust type that implementsPrintable
.Note:
result::Error::err
has aas_any()
method, but that's theAny
object from the outerBox
. What we want is(*self.err).as_any()
to be used in ``impl Printable for Errorwhich doesn't work today becuase
std::error::Error` provides `downcast` but not `as_any`.The text was updated successfully, but these errors were encountered: