  We present a concept called the branch-depth of a connectivity function, that
generalizes the tree-depth of graphs. Then we prove two theorems showing that
this concept aligns closely with the notions of tree-depth and shrub-depth of
graphs as follows. For a graph $G = (V,E)$ and a subset $A $ of $E$ we let
$\lambda_G (A)$ be the number of vertices incident with an edge in $A$ and an
edge in $E \setminus A$. For a subset $X$ of $V$, let $\rho_G(X)$ be the rank
of the adjacency matrix between $X$ and $V \setminus X$ over the binary field.
We prove that a class of graphs has bounded tree-depth if and only if the
corresponding class of functions $\lambda_G$ has bounded branch-depth and
similarly a class of graphs has bounded shrub-depth if and only if the
corresponding class of functions $\rho_G$ has bounded branch-depth, which we
call the rank-depth of graphs.
  Furthermore we investigate various potential generalizations of tree-depth to
matroids and prove that matroids representable over a fixed finite field having
no large circuits are well-quasi-ordered by the restriction.
