  We prove several results on approximate decompositions of edge-coloured
quasirandom graphs into rainbow spanning structures. More precisely, we say
that an edge-colouring of a graph is locally $\ell$-bounded if no vertex is
incident to more than $\ell$ edges of any given colour, and that it is
(globally) $g$-bounded if no colour appears more than $g$ times in the
colouring. Note that every proper colouring of an $n$-vertex graph is locally
$1$-bounded, and (globally) $n/2$-bounded. Our results imply the following:
  (i) The existence of approximate decompositions of edge-coloured $K_n$ into
rainbow almost-spanning cycles, provided that the colouring is
$\frac{n}{2}$-bounded and locally $o(n)$-bounded. (ii) The existence of
approximate decompositions of edge-coloured $K_n$ into rainbow Hamilton cycles,
provided that the colouring is $(1-o(1))\frac n2$-bounded and locally
$o\big(\frac{n}{\log^4 n}\big)$-bounded. (iii) A bipartite version of our
results implies that every $n\times n$ array, where each symbol appears
$(1-o(1))n$ times in total and appears only $o\big(\frac{n}{\log^2 n}\big)$
times in each row or column, has an approximate decomposition into full
transversals.
  We also prove analogues of (i) and (ii) for $F$-factors, where $F$ is any
fixed graph. Apart from the logarithmic factor in (ii), all these bounds are
essentially best possible. (i) can be viewed as a generalization of a recent
result of Alon, Pokrovskiy and Sudakov, who showed the existence of an almost
spanning cycle in a properly coloured complete graph. Both (i) and (ii) imply
approximate versions of a conjecture of Brualdi and Hollingsworth, stating that
every properly edge-coloured complete graph can be decomposed into rainbow
spanning trees.
