Engineers have constructed the first functional structure made completely of chocolate.