Resource–diversity relationships in bacterial communities reflect the network structure of microbial metabolism