Starting with Elixir 1.11 / OTP 23, one can easily define a guard to check the argument is a particular struct. That might be handy in rare cases when the single function clause is ready to accept a mixed argument, and pattern matching directly on the argument would not work.