scalar-config.dhover×179all
#!/usr/bin/env dub
/+ dub.sdl:
    name "wired_scalar_config"
    dependency "sparkles:wired" path="../../.."
    targetPath "build"
    dflags "-preview=in" "-preview=dip1000"
    buildType "checked" {
        buildOptions "optimize" "inline" "debugInfo"
    }
+/
module 
(module) wired_scalar_config
wired_scalar_config
;
import
(package) std
std
.
(module) std.stdio
Category Symbols
File handles _popen File isFileHandle openNetwork stderr stdin stdout
Reading chunks lines readf readfln readln
Writing toFile write writef writefln writeln
Misc KeepTerminator LockType StdioException

Standard I/O functions that extend core.stdc.stdio. core.stdc.stdio is publically imported when importing std.stdio.

There are three layers of I/O:

  1. The lowest layer is the operating system layer. The two main schemes are Windows and Posix.

  2. C's stdio.h which unifies the two operating system schemes.

  3. std.stdio, this module, unifies the various stdio.h implementations into a high level package for D programs.

Source

std/stdio.d

@copyrightCopyright The D Language Foundation 2007-.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Alex Rønne Petersen
stdio
:
(alias template) wired_scalar_config.writeln = std.stdio.writeln(T...)(T args)

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
;
import
(package) sparkles
sparkles
.
(package) sparkles.wired
wired
.
(module) sparkles.wired.config

Retained scalar configuration definitions and original-policy JSON input.

The schema owns defaults and validation; sources carry definition priority and order. Resolution preserves every definition and returns an inspectable snapshot, including conflicts, without choosing a winner by submission order.

Import this module for the C1 scalar interface. Collection composition and report presentation have separate contracts and are not implemented by this package.

config
:
(alias struct) wired_scalar_config.ConfigBuilder = sparkles.wired.config.core.ConfigBuilder(T, A = ConfigAllocator)

A move-only collecting owner. Successful resolution consumes it.

ConfigBuilder
,
(enum) sparkles.wired.config.core.ConfigErrorKind
ConfigErrorKind
,
(alias struct) wired_scalar_config.ConfigInput = sparkles.wired.config.core.ConfigInput(T)
ConfigInput
,
(enum) sparkles.wired.config.core.ConfigSourceKind
ConfigSourceKind
,
(alias struct) wired_scalar_config.DefinitionView = sparkles.wired.config.core.DefinitionView(V)
DefinitionView
,
(enum) sparkles.wired.config.core.OptionStatus
OptionStatus
,
(alias struct) wired_scalar_config.OptionView = sparkles.wired.config.core.OptionView(V)
OptionView
,
(struct) sparkles.wired.config.core.SourceId
SourceId
,
(alias template) wired_scalar_config.decodeConfigInput = sparkles.wired.config.json.decodeConfigInput(T, JsonReadOptions parserOptions = JsonReadOptions.init)(scope const(char)[] text, auto ref scope const DefinitionMetadata!T metadata = DefinitionMetadata!T.init, ConfigLimits limits = ConfigLimits.init, ConfigDecodeOptions options = ConfigDecodeOptions.init)

Decode text with explicit native parser options and detached capsule limits.

decodeConfigInput
,
(alias template) wired_scalar_config.visitDefinitions = sparkles.wired.config.core.visitDefinitions(alias sink, T, A)(ref scope const ConfigSnapshot!(T, A) snapshot, scope const(char)[] path)

Visits all accepted definitions of one option in precedence order.

visitDefinitions
,
(alias template) wired_scalar_config.visitOption = sparkles.wired.config.core.visitOption(alias sink, T, A)(ref scope const ConfigSnapshot!(T, A) snapshot, scope const(char)[] path)

Borrows one option through a typed, scoped sink.

visitOption
;
import
(package) sparkles
sparkles
.
(package) sparkles.wired
wired
.
(module) sparkles.wired.policy

Format-aware @Wire* policy attributes and their value vocabulary.

This module is the format-agnostic policy layer of sparkles:wired: it defines the marker sentinel AnyFormat, the policy enums (Repr, WireTarget, WireSkip, WireInvalid), and the @Wire* user-defined attributes a type author annotates enum members, fields, and types with. A concrete format backend (e.g. sparkles.wired.json) resolves these against its own format tag.

Each value-carrying attribute is a factory function (WireName, WireCase, WireRepr, WireOptional) returning a format-parameterized *Attr struct — so both @WireName("x") and @WireName!Json("x") work as ordinary compile-time calls. Resolvers detect and read the attributes through the *Attr structs.

See docs/specs/wired/SPEC.md §5 for the normative surface.

policy
:
(alias template) wired_scalar_config.WireName = sparkles.metadata.wire.WireName(Format = AnyFormat)(string name)

@WireName!F("text") — the member or field name under format F.

WireName
;
struct
(struct) wired_scalar_config.Settings
Settings
{ @
sparkles.metadata.wire.WireNameAttr!(AnyFormat) sparkles.metadata.wire.WireName!(sparkles.metadata.wire.AnyFormat)(string name) pure nothrow @nogc @safe

@WireName!F("text") — the member or field name under format F.

WireName
("tab-width") int
(field) int wired_scalar_config.Settings.tabWidth
tabWidth
= 4;
} void
void D main() @safe
main
() @safe
{ auto
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigBuilder!(Settings, ConfigAllocator)) created
created
=
(template instance) sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator)
ConfigBuilder
!
(struct) wired_scalar_config.Settings
Settings
.
sparkles.wired.config.core.ConfigResult!(ConfigBuilder!(Settings, ConfigAllocator)) sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).create(sparkles.wired.config.core.ConfigLimits limits = ConfigLimits(1024u, 65536u, 16777216LU, 4096u, 32u), uint builtinPriority = 1500u, int builtinOrder = 0) nothrow @nogc @safe
create
();
assert(
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigBuilder!(Settings, ConfigAllocator)) created
created
.
bool sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator)).hasValue() const pure nothrow @nogc @property scope @safe
hasValue
);
auto
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) builder
builder
=
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigBuilder!(Settings, ConfigAllocator)) created
created
.
sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator)).takeValue() nothrow @nogc @safe
takeValue
();
auto
(local variable) sparkles.wired.config.core.ConfigResult!(SourceRef) source
source
=
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) builder
builder
.
sparkles.wired.config.core.ConfigResult!(SourceRef) sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).registerSource(sparkles.wired.config.core.SourceId id, sparkles.wired.config.core.ConfigSourceKind kind, scope const(char)[] detail, uint priority = 1000u, int order = 0) nothrow @nogc @safe
registerSource
(
(struct) sparkles.wired.config.core.SourceId
SourceId
("user"),
(enum) sparkles.wired.config.core.ConfigSourceKind
ConfigSourceKind
.
(enum value) sparkles.wired.config.core.ConfigSourceKind.userFile = 2
userFile
, "settings.json", 1000);
assert(
(local variable) sparkles.wired.config.core.ConfigResult!(SourceRef) source
source
.
bool sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.SourceRef).hasValue() const pure nothrow @nogc @property scope @safe
hasValue
);
auto
(local variable) sparkles.wired.config.json.ConfigDecodeResult!(Settings) decoded
decoded
=
sparkles.wired.config.json.ConfigDecodeResult!(Settings) sparkles.wired.config.json.decodeConfigInput!(wired_scalar_config.Settings, JsonReadOptions(false, true, 1024u, false, false, false, false, false))(scope const(char)[] text, scope const(sparkles.wired.config.core.DefinitionMetadata!(Settings)) metadata = DefinitionMetadata(LeafDefinitionMetadata(Nullable(DontCallDestructorT(), true), Nullable(DontCallDestructorT(), true), Nullable(DontCallDestructorT(LocalId(null)), true), Nullable(DontCallDestructorT(), true))), sparkles.wired.config.core.ConfigLimits limits = ConfigLimits(1024u, 65536u, 16777216LU, 4096u, 32u), sparkles.wired.config.json.ConfigDecodeOptions options = ConfigDecodeOptions(ConfigUnknownMembers.reject)) @nogc @safe

Decode text with explicit native parser options and detached capsule limits.

decodeConfigInput
!
(struct) wired_scalar_config.Settings
Settings
(`{"tab-width":8}`);
assert(
(local variable) sparkles.wired.config.json.ConfigDecodeResult!(Settings) decoded
decoded
.
bool sparkles.wired.config.json.ConfigDecodeResult!(wired_scalar_config.Settings).hasValue() const pure nothrow @nogc @safe
hasValue
);
auto
(local variable) sparkles.wired.config.core.OwnedConfigInput!(Settings, ConfigAllocator) input
input
=
(local variable) sparkles.wired.config.json.ConfigDecodeResult!(Settings) decoded
decoded
.
sparkles.wired.config.core.OwnedConfigInput!(Settings, ConfigAllocator) sparkles.wired.config.json.ConfigDecodeResult!(wired_scalar_config.Settings).takeValue() nothrow @nogc @safe
takeValue
();
auto
(local variable) sparkles.wired.config.core.ConfigError submitted
submitted
=
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) builder
builder
.
sparkles.wired.config.core.ConfigError sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).submitOwned(sparkles.wired.config.core.SourceRef source, ref sparkles.wired.config.core.OwnedConfigInput!(Settings, ConfigAllocator) input) nothrow @nogc @safe
submitOwned
(
(local variable) sparkles.wired.config.core.ConfigResult!(SourceRef) source
source
.
const(sparkles.wired.config.core.SourceRef) sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.SourceRef).value!()() const pure nothrow @nogc @property scope @safe
value
,
(local variable) sparkles.wired.config.core.OwnedConfigInput!(Settings, ConfigAllocator) input
input
);
assert(
(local variable) sparkles.wired.config.core.ConfigError submitted
submitted
.
(field) sparkles.wired.config.core.ConfigErrorKind sparkles.wired.config.core.ConfigError.kind
kind
==
(enum) sparkles.wired.config.core.ConfigErrorKind
ConfigErrorKind
.
(enum value) sparkles.wired.config.core.ConfigErrorKind.none = cast(ubyte)0u
none
);
auto
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigSnapshot!(Settings, ConfigAllocator)) resolved
resolved
=
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) builder
builder
.
sparkles.wired.config.core.ConfigResult!(ConfigSnapshot!(Settings, ConfigAllocator)) sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).resolve() @safe
resolve
();
assert(
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigSnapshot!(Settings, ConfigAllocator)) resolved
resolved
.
bool sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator)).hasValue() const pure nothrow @nogc @property scope @safe
hasValue
);
auto
(local variable) sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator) snapshot
snapshot
=
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigSnapshot!(Settings, ConfigAllocator)) resolved
resolved
.
sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator) sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator)).takeValue() nothrow @nogc @safe
takeValue
();
auto
(local variable) sparkles.wired.config.core.ConfigResult!(Settings) copied
copied
=
(local variable) sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator) snapshot
snapshot
.
sparkles.wired.config.core.ConfigResult!(Settings) sparkles.wired.config.core.ConfigSnapshot!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).copyConfig() const nothrow @nogc return scope @safe
copyConfig
();
assert(
(local variable) sparkles.wired.config.core.ConfigResult!(Settings) copied
copied
.
bool sparkles.wired.config.core.ConfigResult!(wired_scalar_config.Settings).hasValue() const pure nothrow @nogc @property scope @safe
hasValue
);
void std.stdio.writeln!(string, const(int))(string __param_0, const(int) __param_1) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("tabWidth=",
(local variable) sparkles.wired.config.core.ConfigResult!(Settings) copied
copied
.
const(wired_scalar_config.Settings) sparkles.wired.config.core.ConfigResult!(wired_scalar_config.Settings).value!()() const pure nothrow @nogc @property scope @safe
value
.
(field) int wired_scalar_config.Settings.tabWidth
tabWidth
);
// The same public pipeline can inspect a complete failure without // fabricating a successful configuration or overwriting caller input. auto
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigBuilder!(Settings, ConfigAllocator)) conflictCreated
conflictCreated
=
(template instance) sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator)
ConfigBuilder
!
(struct) wired_scalar_config.Settings
Settings
.
sparkles.wired.config.core.ConfigResult!(ConfigBuilder!(Settings, ConfigAllocator)) sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).create(sparkles.wired.config.core.ConfigLimits limits = ConfigLimits(1024u, 65536u, 16777216LU, 4096u, 32u), uint builtinPriority = 1500u, int builtinOrder = 0) nothrow @nogc @safe
create
();
assert(
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigBuilder!(Settings, ConfigAllocator)) conflictCreated
conflictCreated
.
bool sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator)).hasValue() const pure nothrow @nogc @property scope @safe
hasValue
);
auto
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) conflictBuilder
conflictBuilder
=
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigBuilder!(Settings, ConfigAllocator)) conflictCreated
conflictCreated
.
sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator)).takeValue() nothrow @nogc @safe
takeValue
();
auto
(local variable) sparkles.wired.config.core.ConfigResult!(SourceRef) user
user
=
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) conflictBuilder
conflictBuilder
.
sparkles.wired.config.core.ConfigResult!(SourceRef) sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).registerSource(sparkles.wired.config.core.SourceId id, sparkles.wired.config.core.ConfigSourceKind kind, scope const(char)[] detail, uint priority = 1000u, int order = 0) nothrow @nogc @safe
registerSource
(
(struct) sparkles.wired.config.core.SourceId
SourceId
("user"),
(enum) sparkles.wired.config.core.ConfigSourceKind
ConfigSourceKind
.
(enum value) sparkles.wired.config.core.ConfigSourceKind.userFile = 2
userFile
, "user.json", 1000);
auto
(local variable) sparkles.wired.config.core.ConfigResult!(SourceRef) project
project
=
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) conflictBuilder
conflictBuilder
.
sparkles.wired.config.core.ConfigResult!(SourceRef) sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).registerSource(sparkles.wired.config.core.SourceId id, sparkles.wired.config.core.ConfigSourceKind kind, scope const(char)[] detail, uint priority = 1000u, int order = 0) nothrow @nogc @safe
registerSource
(
(struct) sparkles.wired.config.core.SourceId
SourceId
("project"),
(enum) sparkles.wired.config.core.ConfigSourceKind
ConfigSourceKind
.
(enum value) sparkles.wired.config.core.ConfigSourceKind.projectFile = 3
projectFile
, "project.json", 1000);
assert(
(local variable) sparkles.wired.config.core.ConfigResult!(SourceRef) user
user
.
bool sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.SourceRef).hasValue() const pure nothrow @nogc @property scope @safe
hasValue
&&
(local variable) sparkles.wired.config.core.ConfigResult!(SourceRef) project
project
.
bool sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.SourceRef).hasValue() const pure nothrow @nogc @property scope @safe
hasValue
);
(struct) sparkles.wired.config.core.ConfigInput!(wired_scalar_config.Settings)
ConfigInput
!
(struct) wired_scalar_config.Settings
Settings
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) userInput
userInput
;
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) userInput
userInput
.
(field) sparkles.wired.config.core.DefinitionSlot!int sparkles.wired.config.core.ConfigInput!(wired_scalar_config.Settings).tabWidth
tabWidth
.
(field) bool sparkles.wired.config.core.DefinitionSlot!int.supplied
supplied
= true;
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) userInput
userInput
.
(field) sparkles.wired.config.core.DefinitionSlot!int sparkles.wired.config.core.ConfigInput!(wired_scalar_config.Settings).tabWidth
tabWidth
.
(field) int sparkles.wired.config.core.DefinitionSlot!int.value
value
= 8;
(struct) sparkles.wired.config.core.ConfigInput!(wired_scalar_config.Settings)
ConfigInput
!
(struct) wired_scalar_config.Settings
Settings
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) projectInput
projectInput
;
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) projectInput
projectInput
.
(field) sparkles.wired.config.core.DefinitionSlot!int sparkles.wired.config.core.ConfigInput!(wired_scalar_config.Settings).tabWidth
tabWidth
.
(field) bool sparkles.wired.config.core.DefinitionSlot!int.supplied
supplied
= true;
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) projectInput
projectInput
.
(field) sparkles.wired.config.core.DefinitionSlot!int sparkles.wired.config.core.ConfigInput!(wired_scalar_config.Settings).tabWidth
tabWidth
.
(field) int sparkles.wired.config.core.DefinitionSlot!int.value
value
= 16;
auto
(local variable) sparkles.wired.config.core.ConfigError userSubmitted
userSubmitted
=
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) conflictBuilder
conflictBuilder
.
sparkles.wired.config.core.ConfigError sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).submitBorrowed!()(sparkles.wired.config.core.SourceRef source, ref scope const(sparkles.wired.config.core.ConfigInput!(Settings)) input, scope const(sparkles.wired.config.core.DefinitionMetadata!(Settings)) metadata = DefinitionMetadata(LeafDefinitionMetadata(Nullable(DontCallDestructorT(), true), Nullable(DontCallDestructorT(), true), Nullable(DontCallDestructorT(LocalId(null)), true), Nullable(DontCallDestructorT(), true)))) nothrow @nogc @safe
submitBorrowed
(
(local variable) sparkles.wired.config.core.ConfigResult!(SourceRef) user
user
.
const(sparkles.wired.config.core.SourceRef) sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.SourceRef).value!()() const pure nothrow @nogc @property scope @safe
value
,
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) userInput
userInput
);
auto
(local variable) sparkles.wired.config.core.ConfigError projectSubmitted
projectSubmitted
=
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) conflictBuilder
conflictBuilder
.
sparkles.wired.config.core.ConfigError sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).submitBorrowed!()(sparkles.wired.config.core.SourceRef source, ref scope const(sparkles.wired.config.core.ConfigInput!(Settings)) input, scope const(sparkles.wired.config.core.DefinitionMetadata!(Settings)) metadata = DefinitionMetadata(LeafDefinitionMetadata(Nullable(DontCallDestructorT(), true), Nullable(DontCallDestructorT(), true), Nullable(DontCallDestructorT(LocalId(null)), true), Nullable(DontCallDestructorT(), true)))) nothrow @nogc @safe
submitBorrowed
(
(local variable) sparkles.wired.config.core.ConfigResult!(SourceRef) project
project
.
const(sparkles.wired.config.core.SourceRef) sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.SourceRef).value!()() const pure nothrow @nogc @property scope @safe
value
,
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) projectInput
projectInput
);
assert(
(local variable) sparkles.wired.config.core.ConfigError userSubmitted
userSubmitted
.
(field) sparkles.wired.config.core.ConfigErrorKind sparkles.wired.config.core.ConfigError.kind
kind
==
(enum) sparkles.wired.config.core.ConfigErrorKind
ConfigErrorKind
.
(enum value) sparkles.wired.config.core.ConfigErrorKind.none = cast(ubyte)0u
none
);
assert(
(local variable) sparkles.wired.config.core.ConfigError projectSubmitted
projectSubmitted
.
(field) sparkles.wired.config.core.ConfigErrorKind sparkles.wired.config.core.ConfigError.kind
kind
==
(enum) sparkles.wired.config.core.ConfigErrorKind
ConfigErrorKind
.
(enum value) sparkles.wired.config.core.ConfigErrorKind.none = cast(ubyte)0u
none
);
auto
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigSnapshot!(Settings, ConfigAllocator)) conflictResolved
conflictResolved
=
(local variable) sparkles.wired.config.core.ConfigBuilder!(Settings, ConfigAllocator) conflictBuilder
conflictBuilder
.
sparkles.wired.config.core.ConfigResult!(ConfigSnapshot!(Settings, ConfigAllocator)) sparkles.wired.config.core.ConfigBuilder!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).resolve() @safe
resolve
();
assert(
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigSnapshot!(Settings, ConfigAllocator)) conflictResolved
conflictResolved
.
bool sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator)).hasValue() const pure nothrow @nogc @property scope @safe
hasValue
);
auto
(local variable) sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator) conflict
conflict
=
(local variable) sparkles.wired.config.core.ConfigResult!(ConfigSnapshot!(Settings, ConfigAllocator)) conflictResolved
conflictResolved
.
sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator) sparkles.wired.config.core.ConfigResult!(sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator)).takeValue() nothrow @nogc @safe
takeValue
();
auto
(local variable) sparkles.wired.config.core.ConfigError inspected
inspected
=
(local variable) sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator) conflict
conflict
.
sparkles.wired.config.core.ConfigError sparkles.wired.config.core.visitOption!(function (ref scope const(sparkles.wired.config.core.OptionView!int) view) @safe { assert(view.path == "tabWidth" && (cast(int)view.status == 1) && !view.effective.hasValue()); writeln("tabWidth: ", view.status, " at priority ", view.selectedPriority); } , wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator)(ref scope const(sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator)) snapshot, scope const(char)[] path) @safe

Borrows one option through a typed, scoped sink.

visitOption
!((scope ref const OptionView!int view) {
assert(view.path == "tabWidth" && view.status == OptionStatus.conflict && !view.effective.hasValue); writeln("tabWidth: ", view.status, " at priority ", view.selectedPriority); })("tabWidth"); assert(
(local variable) sparkles.wired.config.core.ConfigError inspected
inspected
.
(field) sparkles.wired.config.core.ConfigErrorKind sparkles.wired.config.core.ConfigError.kind
kind
==
(enum) sparkles.wired.config.core.ConfigErrorKind
ConfigErrorKind
.
(enum value) sparkles.wired.config.core.ConfigErrorKind.none = cast(ubyte)0u
none
);
auto
(local variable) sparkles.wired.config.core.ConfigError definitions
definitions
=
(local variable) sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator) conflict
conflict
.
sparkles.wired.config.core.ConfigError sparkles.wired.config.core.visitDefinitions!(function (ref scope const(sparkles.wired.config.core.DefinitionView!int) view) @safe { writeln(" ", view.priority, " ", view.value.get(), " ", view.disposition); } , wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator)(ref scope const(sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator)) snapshot, scope const(char)[] path) @safe

Visits all accepted definitions of one option in precedence order.

visitDefinitions
!((scope ref const DefinitionView!int view) {
writeln(" ", view.priority, " ", view.value.get, " ", view.disposition); })("tabWidth"); assert(
(local variable) sparkles.wired.config.core.ConfigError definitions
definitions
.
(field) sparkles.wired.config.core.ConfigErrorKind sparkles.wired.config.core.ConfigError.kind
kind
==
(enum) sparkles.wired.config.core.ConfigErrorKind
ConfigErrorKind
.
(enum value) sparkles.wired.config.core.ConfigErrorKind.none = cast(ubyte)0u
none
);
auto
(local variable) sparkles.wired.config.core.ConfigResult!(Settings) refused
refused
=
(local variable) sparkles.wired.config.core.ConfigSnapshot!(Settings, ConfigAllocator) conflict
conflict
.
sparkles.wired.config.core.ConfigResult!(Settings) sparkles.wired.config.core.ConfigSnapshot!(wired_scalar_config.Settings, sparkles.wired.config.core.ConfigAllocator).copyConfig() const nothrow @nogc return scope @safe
copyConfig
();
assert(
(local variable) sparkles.wired.config.core.ConfigResult!(Settings) refused
refused
.
bool sparkles.wired.config.core.ConfigResult!(wired_scalar_config.Settings).hasError() const pure nothrow @nogc @property scope @safe
hasError
&&
(local variable) sparkles.wired.config.core.ConfigResult!(Settings) refused
refused
.
sparkles.wired.config.core.ConfigError sparkles.wired.config.core.ConfigResult!(wired_scalar_config.Settings).error() const pure nothrow @nogc @property return scope @safe
error
.
(field) sparkles.wired.config.core.ConfigErrorKind sparkles.wired.config.core.ConfigError.kind
kind
==
(enum) sparkles.wired.config.core.ConfigErrorKind
ConfigErrorKind
.
(enum value) sparkles.wired.config.core.ConfigErrorKind.notFullyResolved = 14
notFullyResolved
);
assert(
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) userInput
userInput
.
(field) sparkles.wired.config.core.DefinitionSlot!int sparkles.wired.config.core.ConfigInput!(wired_scalar_config.Settings).tabWidth
tabWidth
.
(field) int sparkles.wired.config.core.DefinitionSlot!int.value
value
== 8 &&
(local variable) sparkles.wired.config.core.ConfigInput!(Settings) projectInput
projectInput
.
(field) sparkles.wired.config.core.DefinitionSlot!int sparkles.wired.config.core.ConfigInput!(wired_scalar_config.Settings).tabWidth
tabWidth
.
(field) int sparkles.wired.config.core.DefinitionSlot!int.value
value
== 16);
}