Attean::API::PullParser3pm
Role for parsers that natively return an iterator
Version
This document describes Attean::API::PullParser version 0.035
Overview
The Attean::API::PullParser role defines parsers that can efficiently construct and return an iterator of 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_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.
Methods
This role provides default implementations of 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.
- 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.
Releases
6 releases since Debian 8 (Jessie); the text changed 5 times.