Rust errors

From wikinotes
Revision as of 17:11, 8 February 2023 by Will (talk | contribs) (Created page with "Rust has two primary methods of handling errors. * <code>panic!()</code> halts/exits the program * <code>Result</code> types are for handle-able errors = panic = <blockquote> <syntaxhighlight lang="rust"> </syntaxhighlight> </blockquote><!-- panic --> = Result = <blockquote> <syntaxhighlight lang="rust"> </syntaxhighlight> </blockquote><!-- Result -->")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Rust has two primary methods of handling errors.

  • panic!() halts/exits the program
  • Result types are for handle-able errors

panic

Result