VariantConfig.coerce

Converts the value of key to type of T. Works the same as std.variant's coerce.

struct VariantConfig
@trusted
T
coerce
(
T = string
)
(
const string key
,
const T defaultValue = T.init
)

Parameters

key string

Name of the key to retrieve.

defaultValue T

The value to use if key isn't found.

Return Value

Type: T

T = The converted value.

Meta