async def iter_values( self, start: Key = Key(0), end: Optional[Key] = None, ) -> AsyncIterator[SGNodeAPI]: if end is None: direction = RIGHT elif end < start: direction = LEFT elif end >= start: direction = RIGHT else: raise Exception("Invariant") left, node, right = await self.find(start) if node is not None: cursor = node elif direction is RIGHT: cursor = right elif direction is LEFT: cursor = left else: raise Exception("Invariant") while cursor is not None: if end is not None and not direction.comparison_fn( end, cursor.key): break await trio.hazmat.checkpoint() yield cursor cursor = await self._get_neighbor(cursor, 0, direction)
async def iter_items( self, start: Key = Key(0), end: Optional[Key] = None, ) -> AsyncIterator[Tuple[Key, SGNodeAPI]]: async for node in self.iter_values(start, end): yield node.key, node
async def iter_keys( self, start: Key = Key(0), end: Optional[Key] = None, ) -> AsyncIterator[Key]: async for node in self.iter_values(start, end): yield node.key
def content_key_to_graph_key(key: bytes) -> Key: return Key(big_endian_to_int(key))
def iter_items( self, start: Key = Key(0), end: Optional[Key] = None) -> AsyncIterator[Tuple[Key, SGNodeAPI]]: ...
def iter_values(self, start: Key = Key(0), end: Optional[Key] = None) -> AsyncIterator[SGNodeAPI]: ...
def iter_keys(self, start: Key = Key(0), end: Optional[Key] = None) -> AsyncIterator[Key]: ...