AdvancedModule
PackageReified.Constraint
Building descriptors from keys that were not written by the calling programmer.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| tryCreate | Advanced.tryCreate key arguments | Parses a relative key, returning the parse failure rather than raising. |
| create | Advanced.create key arguments | Parses a relative key, raising for a malformed programmer-authored key. |
| ofSegments | Advanced.ofSegments segments arguments | Builds a descriptor from already-parsed segments, skipping the parse. |
Parses a relative key, returning the parse failure rather than raising.
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | |
| arguments | Map<string, ConstraintValue> |
Returns
Result<MessageDescriptor, MessageKeyError>
Verification Examples
MessageDescriptor.Advanced.tryCreate "books.isbn.invalid" Map.emptyParses a relative key, raising for a malformed programmer-authored key.
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | |
| arguments | Map<string, ConstraintValue> |
Returns
MessageDescriptor
Verification Examples
MessageDescriptor.Advanced.create "books.isbn.invalid" Map.emptyBuilds a descriptor from already-parsed segments, skipping the parse.
Parameters
| Name | Type | Description |
|---|---|---|
| segments | string list | |
| arguments | Map<string, ConstraintValue> |
Returns
MessageDescriptor
Verification Examples
MessageDescriptor.Advanced.ofSegments [ "schema"; "omitted" ] Map.empty