def from_json(buffer):
        """Creates an index from a JSON string."""
        buffer = to_bytes(buffer)
        return Index._from_ptr(rustcall(
            _lib.lsm_index_from_json,
            buffer, len(buffer)))