  The set \[ \overline{\mathbb{E}}= \{ x \in {\mathbb{C}}^3: \quad 1-x_1 z -
x_2 w + x_3 zw \neq 0 \mbox{ whenever } |z| < 1, |w| < 1 \} \] is called the
tetrablock and has intriguing complex-geometric properties. It is polynomially
convex, nonconvex and starlike about $0$. It has a group of automorphisms
parametrised by ${\mathrm{Aut}~} {\mathbb{D}} \times {\mathrm{Aut}~}
{\mathbb{D}} \times {\mathbb{Z}}_2$ and its distinguished boundary
$b\overline{\mathbb{E}}$ is homeomorphic to the solid torus
$\overline{\mathbb{D}} \times {\mathbb{T}}$. It has a special subvariety
\[\mathcal{R}_{\mathbb{\overline{E}}} = \big\{ (x_{1}, x_{2}, x_{3}) \in
\overline{\mathbb{E}} : x_{1}x_{2}=x_{3} \big\}, \] called the royal variety of
$\overline{\mathbb{E}}$, which is a complex geodesic of ${\mathbb{E}}$ that is
invariant under all automorphisms of ${\mathbb{E}}$. We exploit this geometry
to develop an explicit and detailed structure theory for the rational maps from
the unit disc ${\mathbb{D}}$ to $\overline{\mathbb{E}}$ that map the unit
circle ${\mathbb{T}}$ to the distinguished boundary $b\overline{\mathbb{E}}$ of
$\overline{\mathbb{E}}$. Such maps are called rational $\mathbb{ \overline{
E}}$-inner functions. We show that, for each nonconstant rational $\mathbb{
\overline{ E}}$-inner function $x$, either $x(\overline{\mathbb{D}}) \subseteq
\mathcal{R}_{\mathbb{\overline{E}}} \cap \overline{\mathbb{E}}$ or
$x(\overline{\mathbb{D}})$ meets $\mathcal{R}_{\mathbb{\overline{E}}}$ exactly
$deg(x)$ times.
  We study convex subsets of the set $\mathcal{J}$ of all rational $\mathbb{
\overline{ E}}$-inner functions and extreme points of $\mathcal{J}$.
