NAME

Protocol::HAP::Store::Memory - the store contract over plain hashes

SYNOPSIS

use Protocol::HAP::Store::Memory;

my $store = Protocol::HAP::Store::Memory->new;

$store->save_pairing('controller-id', $ltpk, 1);
my $pairings = $store->load_pairings;

DESCRIPTION

This module is the reference implementation of the store contract that Protocol/HAP/Store.pod documents. The state lives in the object and dies with it: nothing persists.

Tests and embedders start here. A production host implements the same twelve methods over durable storage, including the rule that the mutating pairing methods increment the configuration number themselves.

load_pairings returns a copy. A caller that edits the result cannot bypass the increment rule of the mutating methods.

SEE ALSO

Protocol::HAP, Protocol/HAP/Store.pod