Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions specification/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,28 @@ A set of pre-defined reasons is enumerated below:
| STALE | The resolved value is non-authoritative or possibly out of date |
| ERROR | The resolved value was the result of an error. |

> [!NOTE]
> The `reason` should not be limited to the reasons enumerated above. It can be any of the pre-defined reasons, or
> any string value. Some type systems have features which can increase the ergonomics of `reason`, for instance a union
of pre-defined types with a string, or a rust-style enumeration which allows for enumerated values to have associated
content.

```rust
enum Reason {
Static,
Default,
TargetingMatch,
Split,
Cached,
Unknown,
Stale,
Error,
Custom(String)
}

let myReason = Reason::Custom("my-reason".to_string());
```

> [!NOTE]
> The `resolution details` structure is not exposed to the Application Author.
> It defines the data which Provider Authors must return when resolving the value of flags.
Expand Down