1Attean::API::SerializerU(s3e)r Contributed Perl DocumentaAttitoenan::API::Serializer(3)
2
3
4
6 Attean::API::Serializer - Serializer role
7
9 This document describes Attean::API::Serializer version 0.033
10
12 The Attean::API::Serializer role defines a common API for all
13 serializers of typed objects to data (either a byte string or printed
14 to a filehandle).
15
17 The following methods are required by the Attean::API::Serializer role:
18
19 "canonical_media_type"
20 Returns the canonical media type string for the format of this
21 serializer.
22
23 "media_types"
24 Returns an ARRAY reference of media type strings that also identify
25 the format produced by this serializer.
26
27 "handled_type"
28 Returns a Type::Tiny object representing the type of items that are
29 consumed during serialization.
30
31 "file_extensions"
32 Returns an ARRAY reference of file extensions commonly associated
33 with the media types supported by the serializer (and returned by
34 "media_types"). File extensions should NOT include a leading dot.
35
36 "serialize_iter_to_io( $fh, $iterator )"
37 Serializes the elements from the Attean::API::Iterator $iterator to
38 the IO::Handle object $fh.
39
40 serialize_iter_to_bytes( $fh )
41 Serializes the elements from the Attean::API::Iterator $iterator
42 and returns the serialization as a UTF-8 encoded byte string.
43
45 This role provides default implementations of the following methods:
46
47 "serialize_list_to_io( $fh, @elements )"
48 Serializes the objects in @elements to the IO::Handle object $fh.
49
50 serialize_list_to_bytes( @elements )
51 Serializes the objects in @elements and returns the serialization
52 as a UTF-8 encoded byte string.
53
55 Please report any bugs or feature requests to through the GitHub web
56 interface at <https://github.com/kasei/attean/issues>.
57
60 Gregory Todd Williams "<gwilliams@cpan.org>"
61
63 Copyright (c) 2014--2022 Gregory Todd Williams. This program is free
64 software; you can redistribute it and/or modify it under the same terms
65 as Perl itself.
66
67
68
69perl v5.36.0 2023-01-19 Attean::API::Serializer(3)