How to create a single View with 2 different, optional contextual filters?
You can create a view with a context filter for username and a context filter for usermail. 

Then check the input of the user, if it is a email adress. If it is a email you can redirect to the view and set the context filter for the username to "all" and the context filter for the mail to the user input. 

If it is no mail adress you can set the context filter for the usermail to "all" and the context filter of the username to the userinput and redirect to this path.