KiokuD...rialize(3pm)
π KiokuDB::Backend::Serialize π
okay bestie, gather round β this is the KiokuD...rialize(3pm) page, aka the serialization role for backends, and it is lowkey the glue that makes your backend know how to turn entries into blobs and back again. β¨
πΈ NAME πΈ
KiokuDB::Backend::Serialize β the serialization role for backends. that's it, that's the name, slay. π
π VERSION π
version 0.57 β¨
π¦ SYNOPSIS π¦
here's the whole vibe, copy it, love it, make it yours:
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);
}
see how chill that is?? you write two subs, you with the role, you're done. no cap. π«Ά
π DESCRIPTION π
so this role provides provides a consistent way to use serialization modules to handle backend serialization. (yes, "provides provides" β we don't fix it, we respect it, iykyk π)
if you want to see this energy in the wild, go look at:
KiokuDB::Backend::Serialize::StorableKiokuDB::Backend::Serialize::YAMLKiokuDB::Backend::Serialize::JSON
those are the examples, bestie. go peek. π
π REQUIRED METHODS π
if you with this role you MUST bring these two. it's giving main character obligations. π
serializate $entryβ takes aKiokuDB::Entryas an argument. should return a value suitable for storage by the backend. yes it's spelledserializateand yes that's the spelling in the docs, we are simply reporting the facts πdeserialize $blobβ takes whateverserializatereturned and should inflate and return aKiokuDB::Entry. glow-up in reverse, it un-serializes the blob back into a whole entry β¨
π¨ bestie warning: these two are the contract.serializategives you something storable,deserializegives you aKiokuDB::Entryback. if you don't implement both, the role will not be happy with you. fr fr.
π§ AUTHOR π§
Yuval Kogman <nothingmuch@woobling.org> β iconic, ate, left no crumbs. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2014 by Yuval Kogman, Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, you're officially caught up π β this lil' doc came to you courtesy of perl v5.34.0, dated 2022-05-23, and it lives under the name KiokuD...rialize(3pm). mwah, go serialize something gorgeous πβ¨π¦πΈ
π¦ where this page comes from
- debian bookworm: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libkiokudb-perl 0.57-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms