moonfig-serde

    serde backend over MuVirus/moonfig values.

    config
    serde
    moonfig
    Download zip
    Author
    Version
    0.2.0
    License
    Apache-2.0
    Last updated
    16 hours ago
    Downloads
    9

    #moonfig-serde

    serde backend for moonfig. It implements serde's Deserializer over moonfig's Value, so any type that already carries a serde description can be extracted straight from configuration.

    This lives in its own module because moonbit-community/serde.mbt pulls in a macro pipeline (moonbitlang/parser, moonbitlang/async). moon addMuVirus/moonfig stays free of it; hand-written FromConfig needs nothing extra.

    #Install

    moon add MuVirus/moonfig-serde

    import {
    "MuVirus/moonfig/core" @config,
    "MuVirus/moonfig-serde/serde_bridge" @serde_bridge,
    }

    let cfg = @config.Config::new().add(...).build()
    let app : AppConfig = @serde_bridge.extract_serde_from(cfg, "app")