Florian Ragwitz > KiokuDB-0.49 > KiokuDB::Backend::Serialize

Download:
KiokuDB-0.49.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  2
View/Report Bugs
Source   Latest Release: KiokuDB-0.57

NAME ^

KiokuDB::Backend::Serialize - Serialization role for backends

SYNOPSIS ^

    package KiokuDB::Backend::Serialize::Foo;
    use Moose::Role;

    use Foo;

    use namespace::clean -except => 'meta';

    with qw(KiokuDB::Backend::Serialize);

    sub serialize {
        my ( $self, $entry ) = @_;

        Foo::serialize($entry)
    }

    sub deserialize {
        my ( $self, $blob ) = @_;

        Foo::deserialize($blob);
    }

DESCRIPTION ^

This role provides provides a consistent way to use serialization modules to handle backend serialization.

See KiokuDB::Backend::Serialize::Storable, KiokuDB::Backend::Serialize::YAML and KiokuDB::Backend::Serialize::JSON for examples.

REQUIRED METHODS ^

serializate $entry

Takes a KiokuDB::Entry as an argument. Should return a value suitable for storage by the backend.

deserialize $blob

Takes whatever serializate returned and should inflate and return a KiokuDB::Entry.

syntax highlighting: