'Traverses linked list of all tree leaves and returns generator containing all elements stored in index.'

def all(self, limit=(-1), offset=0):

    if (self.root_flag == 'n'):
        leaf_start = (self.data_start + self.node_size)
    else:
        leaf_start = self.data_start
    (nr_of_elements, prev_leaf, next_leaf) = self._read_leaf_nr_of_elements_and_neighbours(leaf_start)
    key_index = 0
    while offset:
        if (key_index < nr_of_elements):
            (curr_key, doc_id, start, size, status) = self._read_single_leaf_record(leaf_start, key_index)
            if (status != 'd'):
                offset -= 1
            key_index += 1
        else:
            key_index = 0
            if next_leaf:
                leaf_start = next_leaf
                (nr_of_elements, prev_leaf, next_leaf) = self._read_leaf_nr_of_elements_and_neighbours(next_leaf)
            else:
                return
    while limit:
        if (key_index < nr_of_elements):
            (curr_key, doc_id, start, size, status) = self._read_single_leaf_record(leaf_start, key_index)
            if (status != 'd'):
                (yield (doc_id, curr_key, start, size, status))
                limit -= 1
            key_index += 1
        else:
            key_index = 0
            if next_leaf:
                leaf_start = next_leaf
                (nr_of_elements, prev_leaf, next_leaf) = self._read_leaf_nr_of_elements_and_neighbours(next_leaf)
            else:
                return
