def chain(*rws):
    """Build a ReadWriter from the given list of ReadWriters.

    .. code-block:: python

        chain(
            number(1),
            number(8),
            len_prefixed_string(number(2)),
        )  # == n1:1 n2:8 s~2

    Reads/writes from the given ReadWriters in-order. Returns lists of values
    in the same order as the ReadWriters.

    :param rws:
        One or more ReadWriters
    """
    assert rws is not None
    if len(rws) == 1 and isinstance(rws[0], list):
        # In case someone does chain([l0, l1, ...])
        rws = rws[0]
    return ChainReadWriter(rws)
Build a ReadWriter from the given list of ReadWriters.

    .. code-block:: python

        chain(
            number(1),
            number(8),
            len_prefixed_string(number(2)),
        )  # == n1:1 n2:8 s~2

    Reads/writes from the given ReadWriters in-order. Returns lists of values
    in the same order as the ReadWriters.

    :param rws:
        One or more ReadWriters