Understanding errors from into_pyobject()
#4781
-
Hello! I was migrating some code to a newer version. In some place, I was using TLDR: I would like to know if a struct that uses Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are some cases where the conversion needs to import a type or call a python method, which can fail. Things like the date/time/hashmap etc related implementations are examples of conversions that can fail. On the other hand, if they cannot fail they use let Ok(x) = y.into_pyobject(); |
Beta Was this translation helpful? Give feedback.
There are some cases where the conversion needs to import a type or call a python method, which can fail. Things like the date/time/hashmap etc related implementations are examples of conversions that can fail. On the other hand, if they cannot fail they use
Infallible
as the error type which means that on a new enough Rust you can write