What's the Rust equivalent return value of a Java function that returns multiple exceptions? -


What is the proper return value of the function in Jungle, which looks like this in Java?

  Zero validation (string input) {if (!! Input)! Return exception 1 ("...."); If (check input 2 (input)) return exception 2 ("...."); If (check input 3 (input)) return exception 3 ("...."); }  

I think this should be the result or result < Bool, & amp; Str & gt; Current position of art in the war:

  • To represent a enum result, being bool being "simplest"
  • a option , complete the result
  • To explain the present function in any form,

  • A results & lt; R, E & gt; A unique challenge, it can be displayed as either:

    • Results & lt; (), Error & gt; Error with
    • option Error & gt; If you search for an error instead of evaluating inworld > function,

    either correct Feeling, results & lt; (), Error & gt; Being more easily responsive to ! and the like.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -