Module mpdpopm::config[][src]

Expand description

mpdpopm Configuration

Introduction

This module defines the configuration struct & handles deserialization thereof.

Discussion

In the first releases of [mpdpopm] I foolishly forgot to add a version field to the configuration structure. I am now paying for my sin by having to attempt serializing two versions until one succeeds.

The idiomatic approach to versioning serde structs seems to be using an enumeration. This implementation now uses that, but that leaves us with the problem of handling the initial, un-tagged version. I proceed as follows:

  1. attempt to deserialize as a member of the modern enumeration
  2. if that succeeds, with the most-recent version, we’re good
  3. if that succeeds with an archaic version, convert to the most recent and warn the user
  4. if that fails, attempt to deserialize as the initial struct version
  5. if that succeeds, convert to the most recent & warn the user
  6. if that fails, I’m kind of stuck because I don’t know what the user was trying to express; bundle-up all the errors, report ’em & urge the user to use the most recent version

Structs

This is the most recent mppopmd configuration struct.

This is the initial version of the mppopmd configuration struct.

Enums

[mpdpopm] can communicate with MPD over either a local Unix socket, or over regular TCP

Functions

Type Definitions