class Parser[T]
Values from a stream of chunks holding concatenated frames.
Values completed before a failure remain observable: the failure is raised by the next call. After a failure, the parser rejects further calls.
Attributes#
| Attribute | Type | Description |
|---|---|---|
end | Effect[None, SchemaError] |
|
Functions#
feed_sync#
feed_sync(chunk) -> list[T]Feeds a chunk and returns the values it completed.
| Parameter | Type | Description |
|---|---|---|
chunk | bytes |
Returns list[T]
def feed_sync(self, chunk: bytes, /) -> list[T]:
"""Feeds a chunk and returns the values it completed."""
...end_sync#
end_sync() -> NoneFinishes; raises SchemaError for an incomplete frame.
def end_sync(self) -> None:
"""Finishes; raises ``SchemaError`` for an incomplete frame."""
...feed#
feed(chunk) -> Effect[list[T], SchemaError]feed_sync as an effect.
| Parameter | Type | Description |
|---|---|---|
chunk | bytes |
Returns Effect[list[T], SchemaError]
def feed(self, chunk: bytes, /) -> Effect[list[T], SchemaError]:
"""``feed_sync`` as an effect."""
...