Before revision: The rank invariant is of great interest in studying both one-dimensional and multidimensional persistence modules. Based on a category theoretical point of view, we generalize the rank invariant to zigzag modules. We prove that the rank invariant of a zigzag module recovers its interval decomposition. This proves that the rank invariant is a complete invariant for zigzag modules. The degree of difference between the rank invariants of any two zigzag modules can be measured via the erosion distance proposed by A.~Patel. We show that this erosion distance is bounded from above by the interleaving distance between the zigzag modules up to a multiplicative constant. Our construction allows us to extend the notion of   \rightarrow C from a category theory perspective.
After revision: When a category \mathcal{C notion of \rightarrow C from a category theory perspective.