You can define Structs by using the defstruct. Here is how you can do it:

BY Best Interview Question ON 13 Jan 2019

Example

iex> defmodule User do
...> defstruct name: "John", age: 27
...> end
iex> defmodule User do
...> defstruct name: "John", age: 27
...> end