1
Rust docs montrent un std::io::Error
être créé à l'aideComment sont chaîne io :: Les erreurs créées
let custom_error = Error::new(ErrorKind::Other, "oh no!");
et new
a une type signature de
fn new<E>(kind: ErrorKind, error: E) -> Error
where E: Into<Box<std::error::Error + Send + Sync>>
J'ai trouvé un implementation de impl<T: std::error::Error> std::error::Error for Box<T>
mais ne trouve pas un pour &'static str
comme celui utilisé dans l'exemple.
Quel trait est utilisé pour atteindre Into<Error>
pour les chaînes?