blob: cea5cc48a83c9084a8596e87f44f42154a6c8f3e [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.data;
/// A value is a boolean, integer, float, string, vector, or dictionary.
union Value {
1: bool bit;
2: int64 inum;
3: float64 fnum;
4: string str;
5: Vector vec;
6: Dictionary dict;
// TODO(CP-154): Consider adding blobs.
};
/// A vector is a sequence of values.
struct Vector {
vector<Value?> values;
};
/// A dictionary is a sequence of key/value pairs.
/// Keys must be unique and sorted in lexicographically increasing order.
struct Dictionary {
vector<Entry> entries;
};
/// A key/value pair in a `Dictionary`.
struct Entry {
string key;
Value? value;
};