---
name: "Attean::API::PushParser"
section: "3pm"
platform: "linux"
package: "libattean-perl"
version: "0.035-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Attean::API::PushParser"
---

# Attean::API::PushParser(3pm)

Role for parsers that natively call a callback function for each parsed item

## NAME

Attean::API::PushParser - Role for parsers that natively call a callback function for each parsed item

## VERSION

This document describes Attean::API::PushParser version 0.035

## DESCRIPTION

The Attean::API::PushParser role defines parsers that can efficiently call a callback function for each object constructed from the parsed data. This role adds methods that builds on this functionality to allow parsing data using different approaches.

## ROLES

This role consumes the Attean::API::Parser role.

## REQUIRED METHODS

Classes consuming this role must provide the following methods:

- parse\_cb\_from\_io( $fh )

  Calls the `"$parser->handler"` function once for each object that result from parsing the data read from the IO::Handle object `$fh`.

- parse\_cb\_from\_bytes( $data )

  Calls the `"$parser->handler"` function once for each object that result from parsing the data read from the UTF-8 encoded byte string `$data`.

## METHODS

This role provides default implementations of the following methods:

- parse\_iter\_from\_io( $fh )

  Returns an Attean::API::Iterator that result from parsing the data read from the IO::Handle object `$fh`.

- parse\_iter\_from\_bytes( $data )

  Returns an Attean::API::Iterator that result from parsing the data read from the UTF-8 encoded byte string `$data`.

- parse\_list\_from\_io( $fh )

  Returns a list of all objects that result from parsing the data read from the IO::Handle object `$fh`.

- parse\_list\_from\_bytes( $data )

  Returns a list of all objects that result from parsing the data read from the UTF-8 encoded byte string `$data`.

## BUGS

Please report any bugs or feature requests to through the GitHub web interface at \<https://github.com/kasei/attean/issues\>.

## SEE ALSO

## AUTHOR

Gregory Todd Williams  `"<gwilliams@cpan.org>"`

## COPYRIGHT

Copyright (c) 2014--2022 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
