powerset

Function powerset 

Source
fn powerset<T>(slice: &[T]) -> Result<Vec<Vec<&T>>, String>
Expand description

The power set (or powerset) of a set S is the set of all subsets of S,
including the empty set and S itself.

Example:

If S is the set {x, y, z}, then all the subsets of S are
{}
{x}
{y}
{z}
{x, y}
{x, z}
{y, z}
{x, y, z}
and hence the power set of S is {{}, {x}, {y}, {z}, {x, y}, {x, z}, {y, z}, {x, y, z}}.